[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] MCE: Fix race condition in mctelem_reserve
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. Actually I read the bitmap, check for all zeroes (some item free) and then use find_first_set_bit to find the bit number set to 1. Frediano _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |