From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by kanga.kvack.org (Postfix) with ESMTP id 2BD866B0005 for ; Wed, 13 Jul 2016 06:00:08 -0400 (EDT) Received: by mail-lf0-f69.google.com with SMTP id g18so29546379lfg.2 for ; Wed, 13 Jul 2016 03:00:08 -0700 (PDT) Received: from outbound-smtp08.blacknight.com (outbound-smtp08.blacknight.com. [46.22.139.13]) by mx.google.com with ESMTPS id ju5si25049wjc.272.2016.07.13.03.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 03:00:06 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id 425C11C1D03 for ; Wed, 13 Jul 2016 11:00:06 +0100 (IST) From: Mel Gorman Subject: [PATCH 0/4] Follow-up fixes to node-lru series v1 Date: Wed, 13 Jul 2016 11:00:00 +0100 Message-Id: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML , Mel Gorman These are some follow-up fixes to the node-lru series based on feedback from Johannes and Minchan. include/linux/vm_event_item.h | 2 +- mm/page-writeback.c | 16 ++++++++++------ mm/vmscan.c | 15 ++++++++------- mm/vmstat.c | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id DCC836B0253 for ; Wed, 13 Jul 2016 06:00:08 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id o80so31951243wme.1 for ; Wed, 13 Jul 2016 03:00:08 -0700 (PDT) Received: from outbound-smtp11.blacknight.com (outbound-smtp11.blacknight.com. [46.22.139.16]) by mx.google.com with ESMTPS id y200si9809337wme.141.2016.07.13.03.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 03:00:06 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 694FC1C1A97 for ; Wed, 13 Jul 2016 11:00:06 +0100 (IST) From: Mel Gorman Subject: [PATCH 1/4] mm, vmscan: Have kswapd reclaim from all zones if reclaiming and buffer_heads_over_limit -fix Date: Wed, 13 Jul 2016 11:00:01 +0100 Message-Id: <1468404004-5085-2-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML , Mel Gorman Johannes reported that the comment about buffer_heads_over_limit in balance_pgdat only made sense in the context of the patch. This patch clarifies the reasoning and how it applies to 32 and 64 bit systems. This is a fix to the mmotm patch mm-vmscan-have-kswapd-reclaim-from-all-zones-if-reclaiming-and-buffer_heads_over_limit.patch Suggested-by: Johannes Weiner Signed-off-by: Mel Gorman --- mm/vmscan.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index d079210d46ee..21eae17ee730 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3131,12 +3131,13 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) /* * If the number of buffer_heads exceeds the maximum allowed - * then consider reclaiming from all zones. This is not - * specific to highmem which may not exist but it is it is - * expected that buffer_heads are stripped in writeback. - * Reclaim may still not go ahead if all eligible zones - * for the original allocation request are balanced to - * avoid excessive reclaim from kswapd. + * then consider reclaiming from all zones. This has a dual + * purpose -- on 64-bit systems it is expected that + * buffer_heads are stripped during active rotation. On 32-bit + * systems, highmem pages can pin lowmem memory and shrinking + * buffers can relieve lowmem pressure. Reclaim may still not + * go ahead if all eligible zones for the original allocation + * request are balanced to avoid excessive reclaim from kswapd. */ if (buffer_heads_over_limit) { for (i = MAX_NR_ZONES - 1; i >= 0; i--) { -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id 2113C6B025F for ; Wed, 13 Jul 2016 06:00:11 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id x83so31396531wma.2 for ; Wed, 13 Jul 2016 03:00:11 -0700 (PDT) Received: from outbound-smtp07.blacknight.com (outbound-smtp07.blacknight.com. [46.22.139.12]) by mx.google.com with ESMTPS id lu3si24997wjb.159.2016.07.13.03.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 03:00:07 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id 9840D1C1FE1 for ; Wed, 13 Jul 2016 11:00:06 +0100 (IST) From: Mel Gorman Subject: [PATCH 2/4] mm: vmstat: account per-zone stalls and pages skipped during reclaim -fix Date: Wed, 13 Jul 2016 11:00:02 +0100 Message-Id: <1468404004-5085-3-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML , Mel Gorman As pointed out by Johannes -- the PG prefix seems to stand for page, and all stat names that contain it represent some per-page event. PGSTALL is not a page event. This patch renames it. This is a fix for the mmotm patch mm-vmstat-account-per-zone-stalls-and-pages-skipped-during-reclaim.patch Signed-off-by: Mel Gorman --- include/linux/vm_event_item.h | 2 +- mm/vmscan.c | 2 +- mm/vmstat.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 6d47f66f0e9c..4d6ec58a8d45 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -23,7 +23,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, FOR_ALL_ZONES(PGALLOC), - FOR_ALL_ZONES(PGSTALL), + FOR_ALL_ZONES(ALLOCSTALL), FOR_ALL_ZONES(PGSCAN_SKIP), PGFREE, PGACTIVATE, PGDEACTIVATE, PGFAULT, PGMAJFAULT, diff --git a/mm/vmscan.c b/mm/vmscan.c index 21eae17ee730..429bf3a9c06c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2674,7 +2674,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, delayacct_freepages_start(); if (global_reclaim(sc)) - __count_zid_vm_events(PGSTALL, sc->reclaim_idx, 1); + __count_zid_vm_events(ALLOCSTALL, sc->reclaim_idx, 1); do { vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup, diff --git a/mm/vmstat.c b/mm/vmstat.c index 7415775faf08..91ecca96dcae 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -980,7 +980,7 @@ const char * const vmstat_text[] = { "pswpout", TEXTS_FOR_ZONES("pgalloc") - TEXTS_FOR_ZONES("pgstall") + TEXTS_FOR_ZONES("allocstall") TEXTS_FOR_ZONES("pgskip") "pgfree", -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id 3E4346B0261 for ; Wed, 13 Jul 2016 06:00:13 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id r190so31932156wmr.0 for ; Wed, 13 Jul 2016 03:00:13 -0700 (PDT) Received: from outbound-smtp08.blacknight.com (outbound-smtp08.blacknight.com. [46.22.139.13]) by mx.google.com with ESMTPS id k3si27015369wma.135.2016.07.13.03.00.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 03:00:07 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id C1E341C204C for ; Wed, 13 Jul 2016 11:00:06 +0100 (IST) From: Mel Gorman Subject: [PATCH 3/4] mm, page_alloc: fix dirtyable highmem calculation Date: Wed, 13 Jul 2016 11:00:03 +0100 Message-Id: <1468404004-5085-4-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML , Mel Gorman From: Minchan Kim Note from Mel: This may optionally be considered a fix to the mmotm patch mm-page_alloc-consider-dirtyable-memory-in-terms-of-nodes.patch but if so, please preserve credit for Minchan. When I tested vmscale in mmtest in 32bit, I found the benchmark was slow down 0.5 times. base node 1 global-1 User 12.98 16.04 System 147.61 166.42 Elapsed 26.48 38.08 With vmstat, I found IO wait avg is much increased compared to base. The reason was highmem_dirtyable_memory accumulates free pages and highmem_file_pages from HIGHMEM to MOVABLE zones which was wrong. With that, dirth_thresh in throtlle_vm_write is always 0 so that it calls congestion_wait frequently if writeback starts. With this patch, it is much recovered. base node fi 1 global-1 fix User 12.98 16.04 13.78 System 147.61 166.42 143.92 Elapsed 26.48 38.08 29.64 Signed-off-by: Minchan Kim Signed-off-by: Mel Gorman --- mm/page-writeback.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 0bca2376bd42..7b41d1290783 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -307,27 +307,31 @@ static unsigned long highmem_dirtyable_memory(unsigned long total) { #ifdef CONFIG_HIGHMEM int node; - unsigned long x = 0; + unsigned long x; int i; - unsigned long dirtyable = atomic_read(&highmem_file_pages); + unsigned long dirtyable = 0; for_each_node_state(node, N_HIGH_MEMORY) { for (i = ZONE_NORMAL + 1; i < MAX_NR_ZONES; i++) { struct zone *z; + unsigned long nr_pages; if (!is_highmem_idx(i)) continue; z = &NODE_DATA(node)->node_zones[i]; - dirtyable += zone_page_state(z, NR_FREE_PAGES); + if (!populated_zone(z)) + continue; + nr_pages = zone_page_state(z, NR_FREE_PAGES); /* watch for underflows */ - dirtyable -= min(dirtyable, high_wmark_pages(z)); - - x += dirtyable; + nr_pages -= min(nr_pages, high_wmark_pages(z)); + dirtyable += nr_pages; } } + x = dirtyable + atomic_read(&highmem_file_pages); + /* * Unreclaimable memory (kernel memory or anonymous memory * without swap) can bring down the dirtyable pages below -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f69.google.com (mail-lf0-f69.google.com [209.85.215.69]) by kanga.kvack.org (Postfix) with ESMTP id 7FD196B0262 for ; Wed, 13 Jul 2016 06:00:15 -0400 (EDT) Received: by mail-lf0-f69.google.com with SMTP id p41so29628185lfi.0 for ; Wed, 13 Jul 2016 03:00:15 -0700 (PDT) Received: from outbound-smtp08.blacknight.com (outbound-smtp08.blacknight.com. [46.22.139.13]) by mx.google.com with ESMTPS id e8si24962wjy.122.2016.07.13.03.00.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 03:00:07 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp08.blacknight.com (Postfix) with ESMTPS id F1F621C2050 for ; Wed, 13 Jul 2016 11:00:06 +0100 (IST) From: Mel Gorman Subject: [PATCH 4/4] mm: move most file-based accounting to the node -fix Date: Wed, 13 Jul 2016 11:00:04 +0100 Message-Id: <1468404004-5085-5-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML , Mel Gorman As noted by Johannes Weiner, NR_ZONE_WRITE_PENDING gets decremented twice during migration instead of a dec(old) -> inc(new) cycle as intended. This is a fix to mmotm patch mm-move-most-file-based-accounting-to-the-node.patch Note that it'll cause a conflict with mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch but that the resolution is trivial. Signed-off-by: Mel Gorman --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index c77997dc6ed7..ed0268268e93 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -515,7 +515,7 @@ int migrate_page_move_mapping(struct address_space *mapping, __dec_node_state(oldzone->zone_pgdat, NR_FILE_DIRTY); __dec_zone_state(oldzone, NR_ZONE_WRITE_PENDING); __inc_node_state(newzone->zone_pgdat, NR_FILE_DIRTY); - __dec_zone_state(newzone, NR_ZONE_WRITE_PENDING); + __inc_zone_state(newzone, NR_ZONE_WRITE_PENDING); } } local_irq_enable(); -- 2.6.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f70.google.com (mail-lf0-f70.google.com [209.85.215.70]) by kanga.kvack.org (Postfix) with ESMTP id A077C6B0253 for ; Wed, 13 Jul 2016 09:10:07 -0400 (EDT) Received: by mail-lf0-f70.google.com with SMTP id g18so32815896lfg.2 for ; Wed, 13 Jul 2016 06:10:07 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id n71si2207530wmg.79.2016.07.13.06.10.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 06:10:06 -0700 (PDT) Date: Wed, 13 Jul 2016 09:10:01 -0400 From: Johannes Weiner Subject: Re: [PATCH 1/4] mm, vmscan: Have kswapd reclaim from all zones if reclaiming and buffer_heads_over_limit -fix Message-ID: <20160713131001.GC9905@cmpxchg.org> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-2-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468404004-5085-2-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Linux-MM , Minchan Kim , LKML On Wed, Jul 13, 2016 at 11:00:01AM +0100, Mel Gorman wrote: > Johannes reported that the comment about buffer_heads_over_limit in > balance_pgdat only made sense in the context of the patch. This patch > clarifies the reasoning and how it applies to 32 and 64 bit systems. > > This is a fix to the mmotm patch > mm-vmscan-have-kswapd-reclaim-from-all-zones-if-reclaiming-and-buffer_heads_over_limit.patch > > Suggested-by: Johannes Weiner > Signed-off-by: Mel Gorman This is a great comment now, thank you. Acked-by: Johannes Weiner -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id 25B746B0260 for ; Wed, 13 Jul 2016 09:10:43 -0400 (EDT) Received: by mail-lf0-f71.google.com with SMTP id l89so32856696lfi.3 for ; Wed, 13 Jul 2016 06:10:43 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id f20si885570wjq.43.2016.07.13.06.10.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 06:10:42 -0700 (PDT) Date: Wed, 13 Jul 2016 09:10:38 -0400 From: Johannes Weiner Subject: Re: [PATCH 2/4] mm: vmstat: account per-zone stalls and pages skipped during reclaim -fix Message-ID: <20160713131038.GD9905@cmpxchg.org> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-3-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468404004-5085-3-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Linux-MM , Minchan Kim , LKML On Wed, Jul 13, 2016 at 11:00:02AM +0100, Mel Gorman wrote: > As pointed out by Johannes -- the PG prefix seems to stand for page, and > all stat names that contain it represent some per-page event. PGSTALL is > not a page event. This patch renames it. > > This is a fix for the mmotm patch > mm-vmstat-account-per-zone-stalls-and-pages-skipped-during-reclaim.patch > > Signed-off-by: Mel Gorman Thanks Acked-by: Johannes Weiner -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 80CFE6B0253 for ; Wed, 13 Jul 2016 09:16:01 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id x83so34840110wma.2 for ; Wed, 13 Jul 2016 06:16:01 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id 16si27936786wmb.72.2016.07.13.06.16.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 06:16:00 -0700 (PDT) Date: Wed, 13 Jul 2016 09:15:55 -0400 From: Johannes Weiner Subject: Re: [PATCH 3/4] mm, page_alloc: fix dirtyable highmem calculation Message-ID: <20160713131555.GE9905@cmpxchg.org> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-4-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468404004-5085-4-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Linux-MM , Minchan Kim , LKML On Wed, Jul 13, 2016 at 11:00:03AM +0100, Mel Gorman wrote: > From: Minchan Kim > > Note from Mel: This may optionally be considered a fix to the mmotm patch > mm-page_alloc-consider-dirtyable-memory-in-terms-of-nodes.patch > but if so, please preserve credit for Minchan. > > When I tested vmscale in mmtest in 32bit, I found the benchmark was slow > down 0.5 times. > > base node > 1 global-1 > User 12.98 16.04 > System 147.61 166.42 > Elapsed 26.48 38.08 > > With vmstat, I found IO wait avg is much increased compared to base. > > The reason was highmem_dirtyable_memory accumulates free pages and > highmem_file_pages from HIGHMEM to MOVABLE zones which was wrong. With > that, dirth_thresh in throtlle_vm_write is always 0 so that it calls > congestion_wait frequently if writeback starts. > > With this patch, it is much recovered. > > base node fi > 1 global-1 fix > User 12.98 16.04 13.78 > System 147.61 166.42 143.92 > Elapsed 26.48 38.08 29.64 > > Signed-off-by: Minchan Kim > Signed-off-by: Mel Gorman Acked-by: Johannes Weiner -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id DDE6C6B0260 for ; Wed, 13 Jul 2016 09:16:37 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id x83so34850321wma.2 for ; Wed, 13 Jul 2016 06:16:37 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id p125si1401978wmp.76.2016.07.13.06.16.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 06:16:36 -0700 (PDT) Date: Wed, 13 Jul 2016 09:16:33 -0400 From: Johannes Weiner Subject: Re: [PATCH 4/4] mm: move most file-based accounting to the node -fix Message-ID: <20160713131633.GF9905@cmpxchg.org> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-5-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468404004-5085-5-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Linux-MM , Minchan Kim , LKML On Wed, Jul 13, 2016 at 11:00:04AM +0100, Mel Gorman wrote: > As noted by Johannes Weiner, NR_ZONE_WRITE_PENDING gets decremented twice > during migration instead of a dec(old) -> inc(new) cycle as intended. > > This is a fix to mmotm patch > mm-move-most-file-based-accounting-to-the-node.patch > > Note that it'll cause a conflict with > mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch > but that the resolution is trivial. > > Signed-off-by: Mel Gorman Acked-by: Johannes Weiner -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by kanga.kvack.org (Postfix) with ESMTP id 09B916B0260 for ; Wed, 13 Jul 2016 21:20:47 -0400 (EDT) Received: by mail-ob0-f200.google.com with SMTP id wu1so121072827obb.0 for ; Wed, 13 Jul 2016 18:20:47 -0700 (PDT) Received: from lgeamrelo13.lge.com (LGEAMRELO13.lge.com. [156.147.23.53]) by mx.google.com with ESMTP id n9si19627243itn.14.2016.07.13.18.20.45 for ; Wed, 13 Jul 2016 18:20:46 -0700 (PDT) Date: Thu, 14 Jul 2016 10:22:04 +0900 From: Minchan Kim Subject: Re: [PATCH 1/4] mm, vmscan: Have kswapd reclaim from all zones if reclaiming and buffer_heads_over_limit -fix Message-ID: <20160714012204.GB23512@bbox> References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-2-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 In-Reply-To: <1468404004-5085-2-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Linux-MM , Johannes Weiner , LKML On Wed, Jul 13, 2016 at 11:00:01AM +0100, Mel Gorman wrote: > Johannes reported that the comment about buffer_heads_over_limit in > balance_pgdat only made sense in the context of the patch. This patch > clarifies the reasoning and how it applies to 32 and 64 bit systems. > > This is a fix to the mmotm patch > mm-vmscan-have-kswapd-reclaim-from-all-zones-if-reclaiming-and-buffer_heads_over_limit.patch > > Suggested-by: Johannes Weiner > Signed-off-by: Mel Gorman > --- > mm/vmscan.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index d079210d46ee..21eae17ee730 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3131,12 +3131,13 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > > /* > * If the number of buffer_heads exceeds the maximum allowed > - * then consider reclaiming from all zones. This is not > - * specific to highmem which may not exist but it is it is > - * expected that buffer_heads are stripped in writeback. > - * Reclaim may still not go ahead if all eligible zones > - * for the original allocation request are balanced to > - * avoid excessive reclaim from kswapd. > + * then consider reclaiming from all zones. This has a dual > + * purpose -- on 64-bit systems it is expected that > + * buffer_heads are stripped during active rotation. On 32-bit > + * systems, highmem pages can pin lowmem memory and shrinking > + * buffers can relieve lowmem pressure. Reclaim may still not It's good but I hope we can make it more clear. On 32-bit systems, highmem pages can pin lowmem pages storing buffer_heads so shrinking highmem pages can relieve lowmem pressure. If you don't think it's much readable compared to yours, feel free to drop. Thanks. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f72.google.com (mail-lf0-f72.google.com [209.85.215.72]) by kanga.kvack.org (Postfix) with ESMTP id 0F11E6B0005 for ; Thu, 14 Jul 2016 10:45:18 -0400 (EDT) Received: by mail-lf0-f72.google.com with SMTP id 33so53991198lfw.1 for ; Thu, 14 Jul 2016 07:45:17 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id l193si34179273wma.4.2016.07.14.07.45.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 14 Jul 2016 07:45:16 -0700 (PDT) Subject: Re: [PATCH 2/4] mm: vmstat: account per-zone stalls and pages skipped during reclaim -fix References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-3-git-send-email-mgorman@techsingularity.net> From: Vlastimil Babka Message-ID: <4d0fda00-5c08-143d-7b43-845f8337e843@suse.cz> Date: Thu, 14 Jul 2016 16:45:15 +0200 MIME-Version: 1.0 In-Reply-To: <1468404004-5085-3-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman , Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML On 07/13/2016 12:00 PM, Mel Gorman wrote: > As pointed out by Johannes -- the PG prefix seems to stand for page, and > all stat names that contain it represent some per-page event. PGSTALL is > not a page event. This patch renames it. > > This is a fix for the mmotm patch > mm-vmstat-account-per-zone-stalls-and-pages-skipped-during-reclaim.patch > > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 71AB56B0005 for ; Thu, 14 Jul 2016 11:22:27 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id o80so58722681wme.1 for ; Thu, 14 Jul 2016 08:22:27 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id o64si34413421wmb.29.2016.07.14.08.22.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 14 Jul 2016 08:22:26 -0700 (PDT) Subject: Re: [PATCH 3/4] mm, page_alloc: fix dirtyable highmem calculation References: <1468404004-5085-1-git-send-email-mgorman@techsingularity.net> <1468404004-5085-4-git-send-email-mgorman@techsingularity.net> From: Vlastimil Babka Message-ID: <1e5938cd-0e03-6cb9-4d5f-fee94fc1479e@suse.cz> Date: Thu, 14 Jul 2016 17:22:25 +0200 MIME-Version: 1.0 In-Reply-To: <1468404004-5085-4-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman , Andrew Morton , Linux-MM Cc: Johannes Weiner , Minchan Kim , LKML On 07/13/2016 12:00 PM, Mel Gorman wrote: > From: Minchan Kim > > Note from Mel: This may optionally be considered a fix to the mmotm patch > mm-page_alloc-consider-dirtyable-memory-in-terms-of-nodes.patch > but if so, please preserve credit for Minchan. > > When I tested vmscale in mmtest in 32bit, I found the benchmark was slow > down 0.5 times. > > base node > 1 global-1 > User 12.98 16.04 > System 147.61 166.42 > Elapsed 26.48 38.08 > > With vmstat, I found IO wait avg is much increased compared to base. > > The reason was highmem_dirtyable_memory accumulates free pages and > highmem_file_pages from HIGHMEM to MOVABLE zones which was wrong. With > that, dirth_thresh in throtlle_vm_write is always 0 so that it calls > congestion_wait frequently if writeback starts. > > With this patch, it is much recovered. > > base node fi > 1 global-1 fix > User 12.98 16.04 13.78 > System 147.61 166.42 143.92 > Elapsed 26.48 38.08 29.64 > > Signed-off-by: Minchan Kim > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Just some nitpicks: > --- > mm/page-writeback.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 0bca2376bd42..7b41d1290783 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -307,27 +307,31 @@ static unsigned long highmem_dirtyable_memory(unsigned long total) > { > #ifdef CONFIG_HIGHMEM > int node; > - unsigned long x = 0; > + unsigned long x; > int i; > - unsigned long dirtyable = atomic_read(&highmem_file_pages); > + unsigned long dirtyable = 0; This wasn't necessary? > > for_each_node_state(node, N_HIGH_MEMORY) { > for (i = ZONE_NORMAL + 1; i < MAX_NR_ZONES; i++) { > struct zone *z; > + unsigned long nr_pages; > > if (!is_highmem_idx(i)) > continue; > > z = &NODE_DATA(node)->node_zones[i]; > - dirtyable += zone_page_state(z, NR_FREE_PAGES); > + if (!populated_zone(z)) > + continue; > > + nr_pages = zone_page_state(z, NR_FREE_PAGES); > /* watch for underflows */ > - dirtyable -= min(dirtyable, high_wmark_pages(z)); > - > - x += dirtyable; > + nr_pages -= min(nr_pages, high_wmark_pages(z)); > + dirtyable += nr_pages; > } > } > > + x = dirtyable + atomic_read(&highmem_file_pages); And then this addition wouldn't be necessary. BTW I think we could also ditch the "x" variable and just use the "dirtyable" for the rest of the function. > + > /* > * Unreclaimable memory (kernel memory or anonymous memory > * without swap) can bring down the dirtyable pages below > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org