Commit d6217476e187b28df3c99100e6f9a054b6ba80c6

Authored by Mel Gorman
Committed by Jiri Slaby
1 parent 6a85a5ad29

mm: page_alloc: only check the alloc flags and gfp_mask for dirty once

commit a6e21b14f22041382e832d30deda6f26f37b1097 upstream.

Currently it's calculated once per zone in the zonelist.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -1915,6 +1915,8 @@
1915 1915 nodemask_t *allowednodes = NULL;/* zonelist_cache approximation */
1916 1916 int zlc_active = 0; /* set if using zonelist_cache */
1917 1917 int did_zlc_setup = 0; /* just call zlc_setup() one time */
  1918 + bool consider_zone_dirty = (alloc_flags & ALLOC_WMARK_LOW) &&
  1919 + (gfp_mask & __GFP_WRITE);
1918 1920  
1919 1921 zonelist_scan:
1920 1922 /*
... ... @@ -1973,8 +1975,7 @@
1973 1975 * will require awareness of zones in the
1974 1976 * dirty-throttling and the flusher threads.
1975 1977 */
1976   - if ((alloc_flags & ALLOC_WMARK_LOW) &&
1977   - (gfp_mask & __GFP_WRITE) && !zone_dirty_ok(zone))
  1978 + if (consider_zone_dirty && !zone_dirty_ok(zone))
1978 1979 continue;
1979 1980  
1980 1981 mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK];