]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: vmscan: set zone flags before blocking
authorMel Gorman <mgorman@suse.de>
Wed, 19 Jun 2013 00:06:02 +0000 (10:06 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:13:02 +0000 (17:13 +1000)
In shrink_page_list a decision may be made to stall and flag a zone as
ZONE_WRITEBACK so that if a large number of unqueued dirty pages are
encountered later then the reclaimer will stall.  Set ZONE_WRITEBACK
before potentially going to sleep so it is noticed sooner.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Cc: Zlatko Calusic <zcalusic@bitsync.net>
Cc: dormando <dormando@rydia.net>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c

index 5b1a79c8f0cb605d4b965d0307d40f5f23d58a23..5f80d018bffaf162c3f74a933501161e8430e72f 100644 (file)
@@ -1445,8 +1445,8 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
         */
        if (nr_writeback && nr_writeback >=
                        (nr_taken >> (DEF_PRIORITY - sc->priority))) {
-               wait_iff_congested(zone, BLK_RW_ASYNC, HZ/10);
                zone_set_flag(zone, ZONE_WRITEBACK);
+               wait_iff_congested(zone, BLK_RW_ASYNC, HZ/10);
        }
 
        /*