Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3907917imd; Mon, 29 Oct 2018 14:24:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5eyJWSd+kOebp45fzl47OWsmrat84JKgDdZbO7mcHIqoH7C8ekOvl0MEPjlQK7RKP6prT59 X-Received: by 2002:a62:13d6:: with SMTP id 83-v6mr92531pft.34.1540848284678; Mon, 29 Oct 2018 14:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540848284; cv=none; d=google.com; s=arc-20160816; b=eqTUtiv9OytSdeujoFSKy/V8COv539pwxe3Y/rNnp+OlNQB1kvXzA5WoQd0TZ0RzYO AjrjoLQwJaXrwFv8dRPiIOZFl1jaxRRqpQ30jSAjssPfTCB46Q9K/hCm1Y1STYvNmqF7 RFEClP2izgjjeYJF7fSlV7jSuDR1/uAhcyMAqs0KmZ3uyIKm1EkldkmcnrSeY09gwHeV /lWwIiBpSrd1Q1OmoYKsy5Ceq9h/uqggM1mSullM2qqYCipnrTtMYhv5DefqGJW2PLyw WgmKpUhTayeJBOfoXyW8dMocIYKA3Im1N8qyWhPauu56S+uqJkBGRcj6OhIPw2DPvmnk amfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Sx5QsMvy83A2Z6CyTwPTU2LgmAsQAQDU3M6HA/+tS8Y=; b=T2BePQwLSsPxnK58o1JOclAj4uSHo9PfWFgrmVTuEmb5t5egPxWZvYWzdleqPfoc1c 0sb3sNBcwuL173jBvZqwJJaJWhCEhVk02AEi5qxJsmHFgwmIAVs00H27M9/zebMZEXQQ gowEKa3gfeCvzJ2bAPOSJk3PCt1VM0pNgFlAFNUvBdIXr92s9kizJ6fhQfU8U4CebmaL 3+1yEDRfuHktSHZm7a7DAW8jFmiO1l8e9wXQ166b++OxOF3W+H5hh6oiBUN5tFpJE6hf fT0tlwpmP0p5olu1JxosMivyVMdcMSl54l9wC/sPqtf5f9gHvJX7uwlIfpvigRQUb4Jq Bl0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3-v6si20758704pld.231.2018.10.29.14.24.28; Mon, 29 Oct 2018 14:24:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727610AbeJ3GNn (ORCPT + 99 others); Tue, 30 Oct 2018 02:13:43 -0400 Received: from shells.gnugeneration.com ([66.240.222.126]:58236 "EHLO shells.gnugeneration.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbeJ3GNm (ORCPT ); Tue, 30 Oct 2018 02:13:42 -0400 Received: by shells.gnugeneration.com (Postfix, from userid 1000) id BF9721A402D8; Mon, 29 Oct 2018 14:23:14 -0700 (PDT) Date: Mon, 29 Oct 2018 14:23:14 -0700 From: Vito Caputo To: Waiman Long Cc: Davidlohr Bueso , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH] fs/proc: introduce /proc/stat2 file Message-ID: <20181029212314.nwruqg6au23ebqlu@shells.gnugeneration.com> References: <20181029192521.23059-1-dave@stgolabs.net> <0afed890-7c5a-93ee-cdb9-e30775bd9cf1@redhat.com> <20181029200050.iejuxckzbm742dmw@linux-r8p5> <3c5ba85b-5114-c751-0114-ac2cb64c02ea@redhat.com> <20181029203818.pot26ewxbncfrnua@linux-r8p5> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 04:59:03PM -0400, Waiman Long wrote: > On 10/29/2018 04:38 PM, Davidlohr Bueso wrote: > > On Mon, 29 Oct 2018, Waiman Long wrote: > > > >> BTW, since you are making stat2 compatible with stat, will that be > >> easier from the user API perspective if we use a sysctl parameter to > >> turn on and off IRQs reporting for /proc/stat, for example? > > > > For one /proc/stat is also common for debugging envs (ie: performance) > > and I fear that if a tunnable modifies the behavior of the output, we > > it might never be usable again (at least not without having users also > > now consider the systctl parameter). Making it dynamic I think is not > > worth it. > > > > Thanks, > > Davidlohr > > This is just a matter if it is easier for users to modify their code to > use /proc/stat2 or turning on a sysctl parameter. Again, this will > certainly depend on the circumstances. > I wonder if it makes sense to introduce a more general mechanism for toggling subfields in proc files. Extended attributes could probably be abused to key the subfields, write a 1 or 0 to well-known names for toggling them on a per-fd basis via fsetxattr. For this particular case the program would just have to add code like: int zero = 0; fsetxattr(proc_stat_fd, "intr", &zero, sizeof(zero), XATTR_REPLACE); Just putting it out there. I've certainly wanted an ability to noop fields before where I was polling proc frequently and skipping the bulk of what was there but syscpu was still rather high. I'm definitely not in favor of just adding another stat file that is the same format as the existing one with the intrs zeroed out. It's a dirty hack; fine for your local needs but too gross for upstream IMHO. Regards, Vito Caputo