[PATCH] Fix buddy list race that could lead to page lru list corruptions
authorNick Piggin <piggin@cyberone.com.au>
Mon, 10 Apr 2006 01:21:48 +0000 (11:21 +1000)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Apr 2006 17:16:37 +0000 (10:16 -0700)
Rohit found an obscure bug causing buddy list corruption.

page_is_buddy is using a non-atomic test (PagePrivate && page_count == 0)
to determine whether or not a free page's buddy is itself free and in the
buddy lists.

Each of the conjuncts may be true at different times due to unrelated
conditions, so the non-atomic page_is_buddy test may find each conjunct to
be true even if they were not both true at the same time (ie. the page was
not on the buddy lists).

Signed-off-by: Martin Bligh <mbligh@google.com>
Signed-off-by: Rohit Seth <rohitseth@google.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

No differences found