Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1376677
| From | Mel Gorman <mgorman@techsingularity.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 26/28] mm: page_alloc: Cache the last node whose dirty limit is reached |
| Date | 2016-04-12 12:50 +0200 |
| Message-ID | <rn43o-643-19@gated-at.bofh.it> (permalink) |
| References | <rn3K1-5ST-3@gated-at.bofh.it> <rn43n-643-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
If a page is about to be dirtied then the page allocator attempts to limit
the total number of dirty pages that exists in any given zone. The call
to node_dirty_ok is expensive so this patch records if the last pgdat
examined hit the dirty limits. In some cases, this reduces the number
of calls to node_dirty_ok().
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
mm/page_alloc.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b54f45876130..490a3cd34b7d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2699,6 +2699,8 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
{
struct zoneref *z = ac->preferred_zoneref;
struct zone *zone;
+ struct pglist_data *last_pgdat_dirty_limit = NULL;
+
/*
* Scan zonelist, looking for a zone with enough free.
* See also __cpuset_node_allowed() comment in kernel/cpuset.c.
@@ -2731,8 +2733,15 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
* will require awareness of nodes in the
* dirty-throttling and the flusher threads.
*/
- if (ac->spread_dirty_pages && !node_dirty_ok(zone->zone_pgdat))
- continue;
+ if (ac->spread_dirty_pages) {
+ if (last_pgdat_dirty_limit == zone->zone_pgdat)
+ continue;
+
+ if (!node_dirty_ok(zone->zone_pgdat)) {
+ last_pgdat_dirty_limit = zone->zone_pgdat;
+ continue;
+ }
+ }
mark = zone->watermark[alloc_flags & ALLOC_WMARK_MASK];
if (!zone_watermark_fast(zone, order, mark,
--
2.6.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/28] Move LRU page reclaim from zones to nodes v4 Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:30 +0200
[PATCH 03/28] mm, vmscan: Move lru_lock to the node Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:30 +0200
[PATCH 09/28] mm, vmscan: Simplify the logic deciding whether kswapd sleeps Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:30 +0200
[PATCH 11/28] mm, vmscan: Clear congestion, dirty and need for compaction on a per-node basis Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:30 +0200
[PATCH 27/28] mm: vmstat: Replace __count_zone_vm_events with a zone id equivalent Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 21/28] mm, vmscan: Update classzone_idx if buffer_heads_over_limit Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 24/28] mm, vmscan: Add classzone information to tracepoints Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 28/28] mm: vmstat: Account per-zone stalls and pages skipped during reclaim Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 17/28] mm: Move page mapped accounting to the node Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 26/28] mm: page_alloc: Cache the last node whose dirty limit is reached Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 25/28] mm, page_alloc: Remove fair zone allocation policy Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 14/28] mm, memcg: Move memcg limit enforcement from zones to nodes Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 15/28] mm, workingset: Make working set detection node-aware Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 23/28] mm: Convert zone_reclaim to node_reclaim Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 20/28] mm: Move vmscan writes and file write accounting to the node Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 16/28] mm, page_alloc: Consider dirtyable memory in terms of nodes Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 18/28] mm: Rename NR_ANON_PAGES to NR_ANON_MAPPED Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 22/28] mm, vmscan: Only wakeup kswapd once per node for the requested classzone Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
[PATCH 19/28] mm: Move most file-based accounting to the node Mel Gorman <mgorman@techsingularity.net> - 2016-04-12 12:50 +0200
csiph-web