[PATCH] Add barriers to avoid race in mempool_alloc/free
authorAndrew Morton <akpm@osdl.org>
Fri, 12 Mar 2004 00:21:24 +0000 (16:21 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 12 Mar 2004 00:21:24 +0000 (16:21 -0800)
commit66d1bbed7bd6fb5c711073e0953adb0850a22d5c
tree0739eb2db68d8072fa6a0ff26063dc233c8a892b
parente798a41d3aa745644dbbec987df14b179043d03c
[PATCH] Add barriers to avoid race in mempool_alloc/free

From: Chris Mason <mason@suse.com>

mempool_alloc() and mempool_free() check pool->curr_nr without any locks
held.  This can lead to skipping a wakeup when there are people waiting,
and sleeping when there are free elements in the pool.

I can't trigger this reliably, but sooner or later someone on ppc is
probably going to hit it.
mm/mempool.c