lkml.org 
[lkml]   [2013]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: manual merge of the workqueues tree with Linus' tree
Hey, Stephen.

On Tue, Mar 19, 2013 at 01:19:38PM +1100, Stephen Rothwell wrote:
> @@@ -456,40 -462,30 +462,30 @@@ static int worker_pool_assign_id(struc
> {
> int ret;
>
> - mutex_lock(&worker_pool_idr_mutex);
> - ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
> - if (ret >= 0)
> - pool->id = ret;
> - mutex_unlock(&worker_pool_idr_mutex);
> + lockdep_assert_held(&wq_mutex);
> +
> + do {
> - if (!idr_pre_get(&worker_pool_idr, GFP_KERNEL))
> - return -ENOMEM;
> - ret = idr_get_new(&worker_pool_idr, pool, &pool->id);
> ++ ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
> ++ if (ret >= 0)
> ++ pool->id = ret;
> + } while (ret == -EAGAIN);
>
> - return ret;
> + return ret < 0 ? ret : 0;

We don't need the loop anymore, so it should look like

static int worker_pool_assign_id(struct worker_pool *pool)
{
int ret;

lockdep_assert_held(&wq_mutex);

ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
if (ret >= 0) {
pool->id = ret;
return 0;
}
return ret;
}

Anyways, I pulled master into wq/for-next and resolved it there, so it
shouldn't cause you any more trouble.

Thanks!

--
tejun


\
 
 \ /
  Last update: 2013-03-19 22:41    [W:0.084 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site