Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211AbdIRCqM (ORCPT ); Sun, 17 Sep 2017 22:46:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:10354 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbdIRCqK (ORCPT ); Sun, 17 Sep 2017 22:46:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,410,1500966000"; d="scan'208";a="901186169" Subject: Re: [PATCH 1/3] mm, sysctl: make VM stats configurable To: Michal Hocko , Dave Hansen Cc: "Luis R . Rodriguez" , Kees Cook , Andrew Morton , Jonathan Corbet , Mel Gorman , Johannes Weiner , Christopher Lameter , Sebastian Andrzej Siewior , Vlastimil Babka , Hillf Danton , Tim Chen , Andi Kleen , Jesper Dangaard Brouer , Ying Huang , Aaron Lu , Proc sysctl , Linux MM , Linux Kernel References: <1505467406-9945-1-git-send-email-kemi.wang@intel.com> <1505467406-9945-2-git-send-email-kemi.wang@intel.com> <20170915114952.czb7nbsioqguxxk3@dhcp22.suse.cz> <20170915142823.jlhsba6rdhx5glfe@dhcp22.suse.cz> From: kemi Message-ID: Date: Mon, 18 Sep 2017 10:44:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170915142823.jlhsba6rdhx5glfe@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1767 Lines: 47 On 2017年09月15日 22:28, Michal Hocko wrote: > On Fri 15-09-17 07:16:23, Dave Hansen wrote: >> On 09/15/2017 04:49 AM, Michal Hocko wrote: >>> Why do we need an auto-mode? Is it safe to enforce by default. >> >> Do we *need* it? Not really. >> >> But, it does offer the best of both worlds: The vast majority of users >> see virtually no impact from the counters. The minority that do need >> them pay the cost *and* don't have to change their tooling at all. > > Just to make it clear, I am not really opposing. It just adds some code > which we can safe... It is also rather chatty for something that can be > true/false. > It has benefit, as Dave mentioned above. Actually, it adds some coding complexity to provide a tuning interface with on/off/auto mode. Using human-readable string instead of magic number makes it easier to use, people probably don't need to review the ABI doc again before using it. So, I don't think that should be a problem >>> Is it> possible that userspace can get confused to see 0 NUMA stats in >> the >>> first read while other allocation stats are non-zero? >> >> I doubt it. Those counters are pretty worthless by themselves. I have >> tooling that goes and reads them, but it aways displays deltas. Read >> stats, sleep one second, read again, print the difference. > > This is how I use them as well. > >> The only scenario I can see mattering is someone who is seeing a >> performance issue due to NUMA allocation misses (or whatever) and wants >> to go look *back* in the past. > > yes > If it really matters, setting vmstat_mode=strict as a default option is a simple way to fix it. What's your idea? thanks >> A single-time printk could also go a long way to keeping folks from >> getting confused. >