public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel•org>
To: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
	Andrew Morton <akpm@linux-foundation•org>
Subject: Re: linux-next: manual merge of the workqueues tree with Linus' tree
Date: Tue, 19 Mar 2013 14:12:33 -0700	[thread overview]
Message-ID: <20130319211233.GN3042@htj.dyndns.org> (raw)
In-Reply-To: <20130319131938.73dd0f1233c8aba41742aded@canb.auug.org.au>

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

  reply	other threads:[~2013-03-19 21:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19  2:19 linux-next: manual merge of the workqueues tree with Linus' tree Stephen Rothwell
2013-03-19 21:12 ` Tejun Heo [this message]
2013-03-19 22:05   ` Stephen Rothwell
2013-03-19 22:13     ` Tejun Heo
2013-03-19 22:20       ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-06-26  4:11 Stephen Rothwell
2021-07-15  1:22 Stephen Rothwell
2014-01-13  4:09 Stephen Rothwell
2013-03-14  4:29 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130319211233.GN3042@htj.dyndns.org \
    --to=tj@kernel$(echo .)org \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox