All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Frediano Ziglio <frediano.ziglio@citrix.com>
Cc: Liu Jinsong <jinsong.liu@intel.com>,
	Christoph Egger <chegger@amazon.de>,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] MCE: Fix race condition in mctelem_reserve
Date: Wed, 22 Jan 2014 13:05:11 +0000	[thread overview]
Message-ID: <52DFC207.3000805@citrix.com> (raw)
In-Reply-To: <1390388414.32296.4.camel@hamster.uk.xensource.com>

On 22/01/14 11:00, Frediano Ziglio wrote:
> On Wed, 2014-01-22 at 10:56 +0000, David Vrabel wrote:
>> On 22/01/14 10:50, Frediano Ziglio wrote:
>>> These lines (in mctelem_reserve)
>>>
>>>
>>>         newhead = oldhead->mcte_next;
>>>         if (cmpxchgptr(freelp, oldhead, newhead) == oldhead) {
>>>
>>> are racy. After you read the newhead pointer it can happen that another
>>> flow (thread or recursive invocation) change all the list but set head
>>> with same value. So oldhead is the same as *freelp but you are setting
>>> a new head that could point to whatever element (even already used).
>>>
>>> This patch use instead a bit array and atomic bit operations.
>>>
>>> Actually it use unsigned long instead of bitmap type as testing for
>>> all zeroes is easier.
>>
>> bitmap_zero() does what you want.
>>
>> David
> 
> No, bitmap_zero fills with zero, do not check for zeroes.

bitmap_empty() sorry.

David

  reply	other threads:[~2014-01-22 13:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 10:50 [PATCH] MCE: Fix race condition in mctelem_reserve Frediano Ziglio
2014-01-22 10:56 ` David Vrabel
2014-01-22 11:00   ` Frediano Ziglio
2014-01-22 13:05     ` David Vrabel [this message]
2014-01-22 12:21 ` Jan Beulich
2014-01-22 17:17   ` [PATCH v2] " Frediano Ziglio
2014-01-30  9:20     ` Frediano Ziglio
2014-01-30  9:55       ` Jan Beulich
2014-01-31 13:37     ` Frediano Ziglio
2014-02-14 16:23       ` Frediano Ziglio
2014-02-14 16:54         ` Jan Beulich
2014-02-16 14:44           ` Liu, Jinsong
2014-02-18 12:47     ` George Dunlap
2014-02-19  9:53       ` Frediano Ziglio
2014-02-19 10:35         ` George Dunlap
2014-02-18  8:42 ` [PATCH] " Liu, Jinsong
2014-02-18 11:10   ` Frediano Ziglio
2014-02-18 11:25     ` Liu, Jinsong

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=52DFC207.3000805@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=chegger@amazon.de \
    --cc=frediano.ziglio@citrix.com \
    --cc=jinsong.liu@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.