Skip to content
  • Linus Torvalds's avatar
    Fix memory ordering bug in page reclaim · 3d80636a
    Linus Torvalds authored
    
    
    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: default avatarLinus Torvalds <torvalds@osdl.org>
    3d80636a