public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Huang Ying <ying.huang@intel.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: RE: [RFC 1/2] lib, Make gen_pool memory allocator lockless
Date: Thu, 10 Feb 2011 16:32:35 +0800	[thread overview]
Message-ID: <1297326755.32714.0.camel@yhuang-dev> (raw)
In-Reply-To: <987664A83D2D224EAE907B061CE93D53019D18D43A@orsmsx505.amr.corp.intel.com>

On Thu, 2011-02-10 at 03:03 +0800, Luck, Tony wrote:
> +static int set_bits_ll(unsigned long *addr, unsigned long mask_to_set)
> +{
> +	unsigned long val, nval;
> +
> +	nval = *addr;
> +	do {
> +		val = nval;
> +		if (val & mask_to_set)
> +			return -EBUSY;
> +	} while ((nval = cmpxchg(addr, val, val | mask_to_set)) != val);
> +
> +	return 0;
> +}
> 
> Spin loops like this should have a call to cpu_relax(), shouldn't they?

Thanks!  Sounds reasonable to me.  Will change it.

Best Regards,
Huang Ying



  reply	other threads:[~2011-02-10  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09  7:27 [RFC 0/2] ACPI, APEI, GHES, printk support for recoverable error via NMI Huang Ying
2011-02-09  7:27 ` [RFC 1/2] lib, Make gen_pool memory allocator lockless Huang Ying
2011-02-09 19:03   ` Luck, Tony
2011-02-10  8:32     ` Huang Ying [this message]
2011-02-09  7:27 ` [RFC 2/2] ACPI, APEI, GHES, printk support for recoverable error via NMI Huang Ying

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=1297326755.32714.0.camel@yhuang-dev \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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