Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbdIOLuz (ORCPT ); Fri, 15 Sep 2017 07:50:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:48128 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751184AbdIOLux (ORCPT ); Fri, 15 Sep 2017 07:50:53 -0400 Date: Fri, 15 Sep 2017 13:50:49 +0200 From: Michal Hocko To: Kemi Wang Cc: "Luis R . Rodriguez" , Kees Cook , Andrew Morton , Jonathan Corbet , Mel Gorman , Johannes Weiner , Christopher Lameter , Sebastian Andrzej Siewior , Vlastimil Babka , Hillf Danton , Dave , Tim Chen , Andi Kleen , Jesper Dangaard Brouer , Ying Huang , Aaron Lu , Proc sysctl , Linux MM , Linux Kernel Subject: Re: [PATCH 2/3] mm: Handle numa statistics distinctively based-on different VM stats modes Message-ID: <20170915115049.vqthfawg3y4r6ogh@dhcp22.suse.cz> References: <1505467406-9945-1-git-send-email-kemi.wang@intel.com> <1505467406-9945-3-git-send-email-kemi.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505467406-9945-3-git-send-email-kemi.wang@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 25 On Fri 15-09-17 17:23:25, Kemi Wang wrote: [...] > @@ -2743,6 +2745,17 @@ static inline void zone_statistics(struct zone *preferred_zone, struct zone *z) > #ifdef CONFIG_NUMA > enum numa_stat_item local_stat = NUMA_LOCAL; > > + /* > + * skip zone_statistics() if vmstat is a coarse mode or zone statistics > + * is inactive in auto vmstat mode > + */ > + > + if (vmstat_mode) { > + if (vmstat_mode == VMSTAT_COARSE_MODE) > + return; > + } else if (disable_zone_statistics) > + return; > + > if (z->node != numa_node_id()) > local_stat = NUMA_OTHER; A jump label could make this completely out of the way for the case where every single cycle matters. -- Michal Hocko SUSE Labs