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 BDE566B0253 for ; Mon, 18 Jul 2016 10:50:29 -0400 (EDT) Received: by mail-lf0-f70.google.com with SMTP id r97so10707787lfi.2 for ; Mon, 18 Jul 2016 07:50:29 -0700 (PDT) Received: from outbound-smtp05.blacknight.com (outbound-smtp05.blacknight.com. [81.17.249.38]) by mx.google.com with ESMTPS id pv4si1535165wjb.165.2016.07.18.07.50.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jul 2016 07:50:27 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp05.blacknight.com (Postfix) with ESMTPS id C8E1398CF6 for ; Mon, 18 Jul 2016 14:50:26 +0000 (UTC) From: Mel Gorman Subject: [PATCH 0/3] Follow-up fixes to node-lru series v3 Date: Mon, 18 Jul 2016 15:50:23 +0100 Message-Id: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Johannes Weiner , Minchan Kim , Vlastimil Babka , Linux-MM , LKML , Mel Gorman This is another round of fixups to the node-lru series. The most important patch is the last one which deals with a highmem accounting issue. include/linux/mm_inline.h | 8 ++------ mm/vmscan.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 20 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-lf0-f70.google.com (mail-lf0-f70.google.com [209.85.215.70]) by kanga.kvack.org (Postfix) with ESMTP id 76AFE6B025F for ; Mon, 18 Jul 2016 10:50:30 -0400 (EDT) Received: by mail-lf0-f70.google.com with SMTP id r97so10708036lfi.2 for ; Mon, 18 Jul 2016 07:50:30 -0700 (PDT) Received: from outbound-smtp06.blacknight.com (outbound-smtp06.blacknight.com. [81.17.249.39]) by mx.google.com with ESMTPS id n24si9041101wmi.20.2016.07.18.07.50.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jul 2016 07:50:27 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp06.blacknight.com (Postfix) with ESMTPS id 46D2598EF8 for ; Mon, 18 Jul 2016 14:50:27 +0000 (UTC) From: Mel Gorman Subject: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change Date: Mon, 18 Jul 2016 15:50:25 +0100 Message-Id: <1468853426-12858-3-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Johannes Weiner , Minchan Kim , Vlastimil Babka , Linux-MM , LKML , Mel Gorman With node-lru, the locking is based on the pgdat. As Minchan pointed out, there is an opportunity to reduce LRU lock release/acquire in check_move_unevictable_pages by only changing lock on a pgdat change. Signed-off-by: Mel Gorman --- mm/vmscan.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 45344acf52ba..a6f31617a08c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3775,24 +3775,24 @@ int page_evictable(struct page *page) void check_move_unevictable_pages(struct page **pages, int nr_pages) { struct lruvec *lruvec; - struct zone *zone = NULL; + struct pglist_data *pgdat = NULL; int pgscanned = 0; int pgrescued = 0; int i; for (i = 0; i < nr_pages; i++) { struct page *page = pages[i]; - struct zone *pagezone; + struct pglist_data *pagepgdat = page_pgdat(page); pgscanned++; - pagezone = page_zone(page); - if (pagezone != zone) { - if (zone) - spin_unlock_irq(zone_lru_lock(zone)); - zone = pagezone; - spin_lock_irq(zone_lru_lock(zone)); + pagepgdat = page_pgdat(page); + if (pagepgdat != pgdat) { + if (pgdat) + spin_unlock_irq(&pgdat->lru_lock); + pgdat = pagepgdat; + spin_lock_irq(&pgdat->lru_lock); } - lruvec = mem_cgroup_page_lruvec(page, zone->zone_pgdat); + lruvec = mem_cgroup_page_lruvec(page, pgdat); if (!PageLRU(page) || !PageUnevictable(page)) continue; @@ -3808,10 +3808,10 @@ void check_move_unevictable_pages(struct page **pages, int nr_pages) } } - if (zone) { + if (pgdat) { __count_vm_events(UNEVICTABLE_PGRESCUED, pgrescued); __count_vm_events(UNEVICTABLE_PGSCANNED, pgscanned); - spin_unlock_irq(zone_lru_lock(zone)); + spin_unlock_irq(&pgdat->lru_lock); } } #endif /* CONFIG_SHMEM */ -- 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-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id A3D3A6B0260 for ; Mon, 18 Jul 2016 10:50:32 -0400 (EDT) Received: by mail-lf0-f71.google.com with SMTP id p41so116812567lfi.0 for ; Mon, 18 Jul 2016 07:50:32 -0700 (PDT) Received: from outbound-smtp11.blacknight.com (outbound-smtp11.blacknight.com. [46.22.139.16]) by mx.google.com with ESMTPS id o74si15240383wme.16.2016.07.18.07.50.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 07:50:27 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 268471C1C39 for ; Mon, 18 Jul 2016 15:50:27 +0100 (IST) From: Mel Gorman Subject: [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones() Date: Mon, 18 Jul 2016 15:50:24 +0100 Message-Id: <1468853426-12858-2-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Johannes Weiner , Minchan Kim , Vlastimil Babka , Linux-MM , LKML , Mel Gorman As pointed out by Minchan Kim, shrink_zones() checks for populated zones in a zonelist but a zonelist can never contain unpopulated zones. While it's not related to the node-lru series, it can be cleaned up now. Suggested-by: Minchan Kim Signed-off-by: Mel Gorman --- mm/vmscan.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 3f06a7a0d135..45344acf52ba 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2605,9 +2605,6 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc) for_each_zone_zonelist_nodemask(zone, z, zonelist, sc->reclaim_idx, sc->nodemask) { - if (!populated_zone(zone)) - continue; - /* * Take care memory controller reclaiming has small influence * to global LRU. -- 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 B764E6B0261 for ; Mon, 18 Jul 2016 10:50:34 -0400 (EDT) Received: by mail-lf0-f69.google.com with SMTP id r97so10709320lfi.2 for ; Mon, 18 Jul 2016 07:50:34 -0700 (PDT) Received: from outbound-smtp02.blacknight.com (outbound-smtp02.blacknight.com. [81.17.249.8]) by mx.google.com with ESMTPS id mf18si1534960wjb.189.2016.07.18.07.50.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jul 2016 07:50:27 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp02.blacknight.com (Postfix) with ESMTPS id 80AA698EF9 for ; Mon, 18 Jul 2016 14:50:27 +0000 (UTC) From: Mel Gorman Subject: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Date: Mon, 18 Jul 2016 15:50:26 +0100 Message-Id: <1468853426-12858-4-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Johannes Weiner , Minchan Kim , Vlastimil Babka , Linux-MM , LKML , Mel Gorman As pointed out by Vlastimil, the atomic_add() functions are already assumed to be able to handle negative numbers. The atomic_sub handling was wrong anyway but this patch fixes it unconditionally. This is a fix to the mmotm patch mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch Signed-off-by: Mel Gorman --- include/linux/mm_inline.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index d29237428199..bcc4ed07fa90 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -10,12 +10,8 @@ extern atomic_t highmem_file_pages; static inline void acct_highmem_file_pages(int zid, enum lru_list lru, int nr_pages) { - if (is_highmem_idx(zid) && is_file_lru(lru)) { - if (nr_pages > 0) - atomic_add(nr_pages, &highmem_file_pages); - else - atomic_sub(nr_pages, &highmem_file_pages); - } + if (is_highmem_idx(zid) && is_file_lru(lru)) + atomic_add(nr_pages, &highmem_file_pages); } #else static inline void acct_highmem_file_pages(int zid, enum lru_list lru, -- 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 6F3D46B0005 for ; Mon, 18 Jul 2016 12:11:40 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id o80so61917027wme.1 for ; Mon, 18 Jul 2016 09:11:40 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id c66si15594722wmi.58.2016.07.18.09.11.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 09:11:39 -0700 (PDT) Date: Mon, 18 Jul 2016 12:11:28 -0400 From: Johannes Weiner Subject: Re: [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones() Message-ID: <20160718161128.GA16465@cmpxchg.org> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-2-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468853426-12858-2-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Minchan Kim , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:24PM +0100, Mel Gorman wrote: > As pointed out by Minchan Kim, shrink_zones() checks for populated > zones in a zonelist but a zonelist can never contain unpopulated > zones. While it's not related to the node-lru series, it can be > cleaned up now. > > Suggested-by: Minchan Kim > Signed-off-by: Mel Gorman Ha, I didn't know that. But yeah, the zonelist building code excludes unpopulated zones from the start. Neat. 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-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id B86A16B0005 for ; Mon, 18 Jul 2016 12:13:42 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id r190so62218300wmr.0 for ; Mon, 18 Jul 2016 09:13:42 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id aw2si1959225wjc.40.2016.07.18.09.13.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 09:13:40 -0700 (PDT) Date: Mon, 18 Jul 2016 12:13:36 -0400 From: Johannes Weiner Subject: Re: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change Message-ID: <20160718161336.GB16465@cmpxchg.org> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-3-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468853426-12858-3-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Minchan Kim , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:25PM +0100, Mel Gorman wrote: > With node-lru, the locking is based on the pgdat. As Minchan pointed > out, there is an opportunity to reduce LRU lock release/acquire in > check_move_unevictable_pages by only changing lock on a pgdat change. > > 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-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id 839126B0253 for ; Mon, 18 Jul 2016 12:14:08 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id f126so62084954wma.3 for ; Mon, 18 Jul 2016 09:14:08 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id qw18si1961567wjb.158.2016.07.18.09.14.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 09:14:07 -0700 (PDT) Date: Mon, 18 Jul 2016 12:14:02 -0400 From: Johannes Weiner Subject: Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Message-ID: <20160718161402.GC16465@cmpxchg.org> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-4-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468853426-12858-4-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Minchan Kim , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:26PM +0100, Mel Gorman wrote: > As pointed out by Vlastimil, the atomic_add() functions are already assumed > to be able to handle negative numbers. The atomic_sub handling was wrong > anyway but this patch fixes it unconditionally. > > This is a fix to the mmotm patch > mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch > > 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-lf0-f70.google.com (mail-lf0-f70.google.com [209.85.215.70]) by kanga.kvack.org (Postfix) with ESMTP id 8947D6B0005 for ; Mon, 18 Jul 2016 16:02:13 -0400 (EDT) Received: by mail-lf0-f70.google.com with SMTP id r97so16136626lfi.2 for ; Mon, 18 Jul 2016 13:02:13 -0700 (PDT) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id o9si16310393wmi.136.2016.07.18.13.02.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 13:02:12 -0700 (PDT) Date: Mon, 18 Jul 2016 16:02:05 -0400 From: Johannes Weiner Subject: Re: [PATCH 0/3] Follow-up fixes to node-lru series v3 Message-ID: <20160718200205.GA27499@cmpxchg.org> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Mel Gorman Cc: Andrew Morton , Minchan Kim , Vlastimil Babka , Linux-MM , LKML The v3 is a bit misleading. It's on top of, not instead of, the v2 series with the same name sent out previously. We need both series. On Mon, Jul 18, 2016 at 03:50:23PM +0100, Mel Gorman wrote: > This is another round of fixups to the node-lru series. The most important > patch is the last one which deals with a highmem accounting issue. > > include/linux/mm_inline.h | 8 ++------ > mm/vmscan.c | 25 +++++++++++-------------- > 2 files changed, 13 insertions(+), 20 deletions(-) -- 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-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id B0F876B025E for ; Mon, 18 Jul 2016 19:54:03 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id p64so5049189pfb.0 for ; Mon, 18 Jul 2016 16:54:03 -0700 (PDT) Received: from lgeamrelo11.lge.com (LGEAMRELO11.lge.com. [156.147.23.51]) by mx.google.com with ESMTP id tf1si2212168pab.230.2016.07.18.16.54.01 for ; Mon, 18 Jul 2016 16:54:03 -0700 (PDT) Date: Tue, 19 Jul 2016 08:54:14 +0900 From: Minchan Kim Subject: Re: [PATCH 1/3] mm, vmscan: Remove redundant check in shrink_zones() Message-ID: <20160718235414.GA9161@bbox> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-2-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 In-Reply-To: <1468853426-12858-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 , Johannes Weiner , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:24PM +0100, Mel Gorman wrote: > As pointed out by Minchan Kim, shrink_zones() checks for populated > zones in a zonelist but a zonelist can never contain unpopulated > zones. While it's not related to the node-lru series, it can be > cleaned up now. > > Suggested-by: Minchan Kim > Signed-off-by: Mel Gorman Acked-by: Minchan Kim 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-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by kanga.kvack.org (Postfix) with ESMTP id 627EC6B025E for ; Mon, 18 Jul 2016 19:58:38 -0400 (EDT) Received: by mail-pa0-f69.google.com with SMTP id hh10so4163851pac.3 for ; Mon, 18 Jul 2016 16:58:38 -0700 (PDT) Received: from lgeamrelo12.lge.com (LGEAMRELO12.lge.com. [156.147.23.52]) by mx.google.com with ESMTP id zy8si24594302pab.68.2016.07.18.16.58.36 for ; Mon, 18 Jul 2016 16:58:37 -0700 (PDT) Date: Tue, 19 Jul 2016 08:58:49 +0900 From: Minchan Kim Subject: Re: [PATCH 2/3] mm, vmscan: Release/reacquire lru_lock on pgdat change Message-ID: <20160718235849.GB9161@bbox> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-3-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 In-Reply-To: <1468853426-12858-3-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 , Johannes Weiner , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:25PM +0100, Mel Gorman wrote: > With node-lru, the locking is based on the pgdat. As Minchan pointed > out, there is an opportunity to reduce LRU lock release/acquire in > check_move_unevictable_pages by only changing lock on a pgdat change. > > Signed-off-by: Mel Gorman > --- > mm/vmscan.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 45344acf52ba..a6f31617a08c 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3775,24 +3775,24 @@ int page_evictable(struct page *page) > void check_move_unevictable_pages(struct page **pages, int nr_pages) > { > struct lruvec *lruvec; > - struct zone *zone = NULL; > + struct pglist_data *pgdat = NULL; > int pgscanned = 0; > int pgrescued = 0; > int i; > > for (i = 0; i < nr_pages; i++) { > struct page *page = pages[i]; > - struct zone *pagezone; > + struct pglist_data *pagepgdat = page_pgdat(page); No need to initialize in here. > > pgscanned++; > - pagezone = page_zone(page); > - if (pagezone != zone) { > - if (zone) > - spin_unlock_irq(zone_lru_lock(zone)); > - zone = pagezone; > - spin_lock_irq(zone_lru_lock(zone)); > + pagepgdat = page_pgdat(page); Double initialize. Please remove either one. > + if (pagepgdat != pgdat) { > + if (pgdat) > + spin_unlock_irq(&pgdat->lru_lock); > + pgdat = pagepgdat; > + spin_lock_irq(&pgdat->lru_lock); > } > - lruvec = mem_cgroup_page_lruvec(page, zone->zone_pgdat); > + lruvec = mem_cgroup_page_lruvec(page, pgdat); > > if (!PageLRU(page) || !PageUnevictable(page)) > continue; > @@ -3808,10 +3808,10 @@ void check_move_unevictable_pages(struct page **pages, int nr_pages) > } > } > > - if (zone) { > + if (pgdat) { > __count_vm_events(UNEVICTABLE_PGRESCUED, pgrescued); > __count_vm_events(UNEVICTABLE_PGSCANNED, pgscanned); > - spin_unlock_irq(zone_lru_lock(zone)); > + spin_unlock_irq(&pgdat->lru_lock); > } > } > #endif /* CONFIG_SHMEM */ > -- > 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-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by kanga.kvack.org (Postfix) with ESMTP id 294176B025F for ; Mon, 18 Jul 2016 19:59:09 -0400 (EDT) Received: by mail-pa0-f71.google.com with SMTP id qh10so4328992pac.2 for ; Mon, 18 Jul 2016 16:59:09 -0700 (PDT) Received: from lgeamrelo11.lge.com (LGEAMRELO11.lge.com. [156.147.23.51]) by mx.google.com with ESMTP id tr8si1950868pab.170.2016.07.18.16.59.07 for ; Mon, 18 Jul 2016 16:59:08 -0700 (PDT) Date: Tue, 19 Jul 2016 08:59:19 +0900 From: Minchan Kim Subject: Re: [PATCH 3/3] mm, vmstat: remove zone and node double accounting by approximating retries -fix Message-ID: <20160718235919.GC9161@bbox> References: <1468853426-12858-1-git-send-email-mgorman@techsingularity.net> <1468853426-12858-4-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 In-Reply-To: <1468853426-12858-4-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 , Johannes Weiner , Vlastimil Babka , Linux-MM , LKML On Mon, Jul 18, 2016 at 03:50:26PM +0100, Mel Gorman wrote: > As pointed out by Vlastimil, the atomic_add() functions are already assumed > to be able to handle negative numbers. The atomic_sub handling was wrong > anyway but this patch fixes it unconditionally. > > This is a fix to the mmotm patch > mm-vmstat-remove-zone-and-node-double-accounting-by-approximating-retries.patch > > Signed-off-by: Mel Gorman Acked-by: Minchan Kim -- 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