• Andrew Morton's avatar
    [PATCH] shrink_list(): check PageSwapCache() after add_to_swap() · 5b1116c3
    Andrew Morton authored
    From: Nikita Danilov <Nikita@Namesys.COM>
    
    shrink_list() checks PageSwapCache() before calling add_to_swap(), this
    means that anonymous page that is going to be added to the swap right
    now these checks return false and:
    
     (*) it will be unaccounted for in nr_mapped, and
    
     (*) it won't be written to the swap if gfp_flags include __GFP_IO but
         not __GFP_FS.
    
    (Both will happen only on the next round of scanning.)
    
    Patch below just moves may_enter_fs initialization down. I am not sure
    about (*nr_mapped) increase though.
    5b1116c3
vmscan.c 30 KB