Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2938306imu; Wed, 7 Nov 2018 02:05:14 -0800 (PST) X-Google-Smtp-Source: AJdET5ffm7tc1sf9mnq2qDt0LCO0wGIb93UDoK1RSPtwQsLbNvctu78VqMS7qV1MkxXwaBSSAPa0 X-Received: by 2002:a62:da54:: with SMTP id w20-v6mr1241813pfl.106.1541585114800; Wed, 07 Nov 2018 02:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541585114; cv=none; d=google.com; s=arc-20160816; b=G20HUdBxojijDL1M38FKZ7QqKLRY+PfaPCjpmgywaRFRYQlghszonyfNGfwQKrV/p6 a8FK8inNXkTcAw+ofSqOyEic1zrF50dvnG0s8HXD9eDnDfGI9hM4ajmmyd80exhKutUJ gFVV63s7keTqjKqnhXdlpGb4PeiOv0JbZ5r0sPPk0m6HAr+bHUzi+mZqkpAmCxHXc57W XCtT0wrI41e83TPpdYdL4w2XKekSMJ7Q7nuvDQCY0NhAWrrpuBe8RpPVEj+gA0heT1fy CG52qByeVvJCqnsdEkOUdV9c3RQw/rl4xgV7X/JGtgakevJ+MlEBLCJnUWAB0eQk2Xlr EDng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=kw3I7EGQTmPKXZQK+S2Uf6SBkCcBvCph0lYiD6RjiSQ=; b=1JGQk+z7MXbLdFyrYyjNnSxTvsuoPuTMKx9Q5zWn8qEVW/CoaZVGGEBzfGo7mdyrzo YlGDBh54a8tqtleSmlbRcBWDXdBC28PSFl74oyHoPJTGPUO7cnx4uEXst2Bu1MBmCyqc BrrHDae4gimKKuJvQxiwev4rDSvqxHtImRovbGg32zu3czDNwzPf0B956dCKMocOE2lv v1gQ43nbRPQmyFEMAuq0n1sh8dshHKI6spWzk0b7L1i5ArDbBWzZmiyHfbRQcjFUmI21 R8QjlQL03KkBQTECTkAAunlp+Vna0g5NbM1NBmmApNES8gBx4/gZ0QsH42xPfDAcEt/+ wU0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=fyKei1FQ; 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 u72si141895pgc.360.2018.11.07.02.04.59; Wed, 07 Nov 2018 02:05:14 -0800 (PST) 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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=fyKei1FQ; 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 S1730400AbeKGTcq (ORCPT + 99 others); Wed, 7 Nov 2018 14:32:46 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:40117 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbeKGTcq (ORCPT ); Wed, 7 Nov 2018 14:32:46 -0500 Received: by mail-io1-f68.google.com with SMTP id a23-v6so11483863iod.7 for ; Wed, 07 Nov 2018 02:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kw3I7EGQTmPKXZQK+S2Uf6SBkCcBvCph0lYiD6RjiSQ=; b=fyKei1FQv0vMdER0iyoH0SQaMhpHjKLKUE0Ti2GH9qogDzh11Uo52jSq7pQplqjKyK 1piIUKcBMWIyn1V0Y6m1foV/LeO3wX5k96YwVpHgQgb7tlrSAxtaHDjIJeL86Z3Ffgxz BsTS/GoGxboyvtfNtjyq3l2m7cvEq345USWco= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kw3I7EGQTmPKXZQK+S2Uf6SBkCcBvCph0lYiD6RjiSQ=; b=KnbXQ0HDy++iV4uZNqA3KBJRLSNY4FadIT6/y6HkbAXkrTHzkBoaUE3O1gHAeGxjkg lAfnm+Et/XCSyQpHprNmSit8betjZtflXmqjw70FXsPCozjknGncp2yhqQJgHt/zk1Zd Z70lMFpdvExN+Uxl2dP7ka8epsYIRsZL7G1IlYoaP+lR/sdDfM6CqzMcfeEpYuNoLrIx Wiq6+iT0Sp2zJ9FHT5Jx7PHEWT2BsUuX1JYvU2LfQHhJJgoaJpvKPNnY5N+oAXLd95dA fnbYXPUOLdPP7efQ8f9zYYFgx70xn8hZEcyGrQJtdowCQmYLCfvDXpxRR5fcBArW/zKn TRbQ== X-Gm-Message-State: AGRZ1gLcV2ATU2PSvoYw4kLNzH6A61TTXqr+tjA7+RsWguQRKM0dSohF jGVBPGcgcUPYynEJXLbT4esfu5o0TZashpmFD86M6w== X-Received: by 2002:a5e:8b42:: with SMTP id z2-v6mr745406iom.144.1541584987760; Wed, 07 Nov 2018 02:03:07 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:ac42:0:0:0:0:0 with HTTP; Wed, 7 Nov 2018 02:03:06 -0800 (PST) X-Originating-IP: [212.96.48.140] In-Reply-To: <20181106154840.3b448356214afa63dc8cb28c@linux-foundation.org> References: <20181029192521.23059-1-dave@stgolabs.net> <20181106154840.3b448356214afa63dc8cb28c@linux-foundation.org> From: Miklos Szeredi Date: Wed, 7 Nov 2018 11:03:06 +0100 Message-ID: Subject: Re: [PATCH] fs/proc: introduce /proc/stat2 file To: Andrew Morton Cc: Daniel Colascione , Davidlohr Bueso , longman@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel , Davidlohr Bueso Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 7, 2018 at 12:48 AM, Andrew Morton wrote: > On Mon, 29 Oct 2018 23:04:45 +0000 Daniel Colascione wrote: > >> On Mon, Oct 29, 2018 at 7:25 PM, Davidlohr Bueso wrote: >> > This patch introduces a new /proc/stat2 file that is identical to the >> > regular 'stat' except that it zeroes all hard irq statistics. The new >> > file is a drop in replacement to stat for users that need performance. >> >> For a while now, I've been thinking over ways to improve the >> performance of collecting various bits of kernel information. I don't >> think that a proliferation of special-purpose named bag-of-fields file >> variants is the right answer, because even if you add a few info-file >> variants, you're still left with a situation where a given file >> provides a particular caller with too little or too much information. >> I'd much rather move to a model in which userspace *explicitly* tells >> the kernel which fields it wants, with the kernel replying with just >> those particular fields, maybe in their raw binary representations. >> The ASCII-text bag-of-everything files would remain available for >> ad-hoc and non-performance critical use, but programs that cared about >> performance would have an efficient bypass. One concrete approach is >> to let users open up today's proc files and, instead of read(2)ing a >> text blob, use an ioctl to retrieve specified and targeted information >> of the sort that would normally be encoded in the text blob. Because >> callers would open the same file when using either the text or binary >> interfaces, little would have to change, and it'd be easy to implement >> fallbacks when a particular system doesn't support a particular >> fast-path ioctl. Please. Sysfs, with the one value per file rule, was created exactly for the purpose of eliminating these sort of problems with procfs. So instead of inventing special purpose interfaces for proc, just make the info available in sysfs, if not already available. Thanks, Miklos