diff options
author | Mel Gorman <mgorman@techsingularity.net> | 2018-12-28 03:35:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 15:11:48 -0500 |
commit | a921444382b49cc7fdeca3fba3e278bc09484a27 (patch) | |
tree | 2437250398beef4bc4343ae123716a3d9d7f46ee /mm/page_alloc.c | |
parent | 6bb154504f8b496780ec53ec81aba957a12981fa (diff) |
mm: move zone watermark accesses behind an accessor
This is a preparation patch only, no functional change.
Link: http://lkml.kernel.org/r/20181123114528.28802-3-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Zi Yan <zi.yan@cs.rutgers.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 251b8a0c9c5d..2046e333ea8f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3376,7 +3376,7 @@ retry: | |||
3376 | } | 3376 | } |
3377 | } | 3377 | } |
3378 | 3378 | ||
3379 | mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK]; | 3379 | mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK); |
3380 | if (!zone_watermark_fast(zone, order, mark, | 3380 | if (!zone_watermark_fast(zone, order, mark, |
3381 | ac_classzone_idx(ac), alloc_flags)) { | 3381 | ac_classzone_idx(ac), alloc_flags)) { |
3382 | int ret; | 3382 | int ret; |
@@ -4793,7 +4793,7 @@ long si_mem_available(void) | |||
4793 | pages[lru] = global_node_page_state(NR_LRU_BASE + lru); | 4793 | pages[lru] = global_node_page_state(NR_LRU_BASE + lru); |
4794 | 4794 | ||
4795 | for_each_zone(zone) | 4795 | for_each_zone(zone) |
4796 | wmark_low += zone->watermark[WMARK_LOW]; | 4796 | wmark_low += low_wmark_pages(zone); |
4797 | 4797 | ||
4798 | /* | 4798 | /* |
4799 | * Estimate the amount of memory available for userspace allocations, | 4799 | * Estimate the amount of memory available for userspace allocations, |
@@ -7431,13 +7431,13 @@ static void __setup_per_zone_wmarks(void) | |||
7431 | 7431 | ||
7432 | min_pages = zone_managed_pages(zone) / 1024; | 7432 | min_pages = zone_managed_pages(zone) / 1024; |
7433 | min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL); | 7433 | min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL); |
7434 | zone->watermark[WMARK_MIN] = min_pages; | 7434 | zone->_watermark[WMARK_MIN] = min_pages; |
7435 | } else { | 7435 | } else { |
7436 | /* | 7436 | /* |
7437 | * If it's a lowmem zone, reserve a number of pages | 7437 | * If it's a lowmem zone, reserve a number of pages |
7438 | * proportionate to the zone's size. | 7438 | * proportionate to the zone's size. |
7439 | */ | 7439 | */ |
7440 | zone->watermark[WMARK_MIN] = tmp; | 7440 | zone->_watermark[WMARK_MIN] = tmp; |
7441 | } | 7441 | } |
7442 | 7442 | ||
7443 | /* | 7443 | /* |
@@ -7449,8 +7449,8 @@ static void __setup_per_zone_wmarks(void) | |||
7449 | mult_frac(zone_managed_pages(zone), | 7449 | mult_frac(zone_managed_pages(zone), |
7450 | watermark_scale_factor, 10000)); | 7450 | watermark_scale_factor, 10000)); |
7451 | 7451 | ||
7452 | zone->watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp; | 7452 | zone->_watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp; |
7453 | zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2; | 7453 | zone->_watermark[WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2; |
7454 | 7454 | ||
7455 | spin_unlock_irqrestore(&zone->lock, flags); | 7455 | spin_unlock_irqrestore(&zone->lock, flags); |
7456 | } | 7456 | } |