From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838AbcBWSNZ (ORCPT ); Tue, 23 Feb 2016 13:13:25 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:59832 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754590AbcBWSNY (ORCPT ); Tue, 23 Feb 2016 13:13:24 -0500 Date: Tue, 23 Feb 2016 10:13:18 -0800 From: Johannes Weiner To: Mel Gorman Cc: Linux-MM , Rik van Riel , Vlastimil Babka , LKML Subject: Re: [PATCH 03/27] mm, vmstat: Add infrastructure for per-node vmstats Message-ID: <20160223181318.GC13816@cmpxchg.org> References: <1456239890-20737-1-git-send-email-mgorman@techsingularity.net> <1456239890-20737-4-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456239890-20737-4-git-send-email-mgorman@techsingularity.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2016 at 03:04:26PM +0000, Mel Gorman wrote: > VM statistic counters for reclaim decisions are zone-based. If the kernel > is to reclaim on a per-node basis then we need to track per-node statistics > but there is no infrastructure for that. The most notable change is that > the old node_page_state is renamed to sum_zone_node_page_state. The new > node_page_state takes a pglist_data and uses per-node stats but none exist > yet. There is some renaming such as vm_stat to vm_zone_stat and the addition > of vm_node_stat and the renaming of mod_state to mod_zone_state. Otherwise, > this is mostly a mechanical patch with no functional change. There is a > lot of similarity between the node and zone helpers which is unfortunate > but there was no obvious way of reusing the code and maintaining type safety. > > Signed-off-by: Mel Gorman Hopefully we can eventually ditch /proc/zoneinfo in favor of a /proc/nodeinfo and get rid of the per-zone stats accounting. In general, this patch looks good to me. Acked-by: Johannes Weiner Only one thing I noticed: > @@ -349,12 +349,14 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, > shadow_nodes = list_lru_shrink_count(&workingset_shadow_nodes, sc); > local_irq_enable(); > > - if (memcg_kmem_enabled()) > + if (memcg_kmem_enabled()) { > pages = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid, > LRU_ALL_FILE); > - else > - pages = node_page_state(sc->nid, NR_ACTIVE_FILE) + > - node_page_state(sc->nid, NR_INACTIVE_FILE); > + } else { > + pg_data_t *pgdat = NODE_DATA(sc->nid); > + pages = node_page_state(pgdat, NR_ACTIVE_FILE) + > + node_page_state(pgdat, NR_INACTIVE_FILE); > + } That should also be sum_zone_node_page_state, right? These are not valid node items (yet).