• Fengguang Wu's avatar
    mm: use global_dirty_limit in throttle_vm_writeout() · 47a13333
    Fengguang Wu authored
    When starting a memory hog task, a desktop box w/o swap is found to go
    unresponsive for a long time.  It's solely caused by lots of congestion
    waits in throttle_vm_writeout():
    
     gnome-system-mo-4201 553.073384: congestion_wait: throttle_vm_writeout+0x70/0x7f shrink_mem_cgroup_zone+0x48f/0x4a1
     gnome-system-mo-4201 553.073386: writeback_congestion_wait: usec_timeout=100000 usec_delayed=100000
               gtali-4237 553.080377: congestion_wait: throttle_vm_writeout+0x70/0x7f shrink_mem_cgroup_zone+0x48f/0x4a1
               gtali-4237 553.080378: writeback_congestion_wait: usec_timeout=100000 usec_delayed=100000
                Xorg-3483 553.103375: congestion_wait: throttle_vm_writeout+0x70/0x7f shrink_mem_cgroup_zone+0x48f/0x4a1
                Xorg-3483 553.103377: writeback_congestion_wait: usec_timeout=100000 usec_delayed=100000
    
    The root cause is, the dirty threshold is knocked down a lot by the memory
    hog task.  Fixed by using global_dirty_limit which decreases gradually on
    such events and can guarantee we stay above (the also decreasing) nr_dirty
    in the progress of following down to the new dirty threshold.
    Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Greg Thelen <gthelen@google.com>
    Cc: Ying Han <yinghan@google.com>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Reviewed-by: default avatarRik van Riel <riel@redhat.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Minchan Kim <minchan.kim@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    47a13333
page-writeback.c 67.3 KB