]> git.baikalelectronics.ru Git - kernel.git/commit
Fix memory ordering bug in page reclaim
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 17 Oct 2005 00:36:06 +0000 (17:36 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 17 Oct 2005 00:36:06 +0000 (17:36 -0700)
commitdd546544ef2a0f5e44af830e336f238ca4edeb72
tree39b3dbae53938728c55b2312190561b858431d92
parentabf3ea1eb6ca9fbefe5a978674a63c592d775737
Fix memory ordering bug in page reclaim

As noticed by Nick Piggin, we need to make sure that we check the page
count before we check for PageDirty, since the dirty check is only valid
if the count implies that we're the only possible ones holding the page.

We always did do this, but the code needs a read-memory-barrier to make
sure that the orderign is also honored by the CPU.

(The writer side is ordered due to the atomic decrement and test on the
page count, see the discussion on linux-kernel)

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/vmscan.c