Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3998148imd; Mon, 29 Oct 2018 16:05:40 -0700 (PDT) X-Google-Smtp-Source: AJdET5c/GdsbIXTWXlKlz6l/xJAraymKdinO8DgTtastTfwyOsmioNfpSOHu90Tz8ynXFDHWshgx X-Received: by 2002:a63:588:: with SMTP id 130mr15478376pgf.273.1540854340854; Mon, 29 Oct 2018 16:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540854340; cv=none; d=google.com; s=arc-20160816; b=iSFecPwD5QtygUwRgfhR4UjgMExgzRxuvs/sv5G37sK2sIY+PU6/pRIrvSuK2Vq5wN w8VWHcU4qyp88/kTPk0FfmOCXU5xlNz47xbqX7ZvVWidH//DEqcnFwtp+UsoejF9dKOX urKu4LbXVOLM+yF05W/KAqOxmePwiHdt9HJK7uJqx82QLnnCy2YV5ktl15mrRhKQAE2S iLe1BHrEfyh1S1ylq/1/ECZS0QL2gtmmCZSpZdtk3iZv8SWn30cuBsX6levBDTpK+V8S L6e0WVfGQiI/4gBi6cSTAtWFpiHntQImZKUH/oaNeFu3KJWZaxRWH1hAcCdNQdRKj99P jy5Q== 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=jPr8P9Yb6cTAfPKz4G37rJkKpt8pjHR2nbgyaSZtI28=; b=NZMtwevVaKL9FrK2nXLDgxcW/rG1nBzq4cBly6Sky96m1cjejpGf+8UJzsmsnLF8g7 n+pWA3XffXy52rOuoRkuouI+vp7MxyHsxQDczcVGzPNAfifoX4oVhuZ1KbbpfXlq7fNz Jegt3COCGDdl/5BP0DUh8ft1sV7AVFS2qzeOjzK4zKPd0RjaB48mlJVY0Xk2gLFfg3+3 N/Fz0jbe6LX6ufBfrUuAXvRmdzbaCb7JoFvYkjfvm2dB6ujyHNzm7JNLC9aQr1mIKUqn iGzKKhEtydy4F8NDR6LV4FFNMcxxk8Dtjl4U4epEoWJlUpAKQM6D9bNvTiwhoLaoROVF 4LAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="b6l/2fJ1"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si21190842plz.196.2018.10.29.16.05.23; Mon, 29 Oct 2018 16:05:40 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="b6l/2fJ1"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731007AbeJ3Hzj (ORCPT + 99 others); Tue, 30 Oct 2018 03:55:39 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:36036 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730869AbeJ3Hzi (ORCPT ); Tue, 30 Oct 2018 03:55:38 -0400 Received: by mail-ua1-f66.google.com with SMTP id w19so3744436uaj.3 for ; Mon, 29 Oct 2018 16:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jPr8P9Yb6cTAfPKz4G37rJkKpt8pjHR2nbgyaSZtI28=; b=b6l/2fJ1IHh7Q6/FqKNHFXdPndabf7nkyugFOSeIIqrmulvRd7oftuAEgM+67JAS6n hoEO+lPYFXQ1aUCm7klGJTU9Z2WJGGVI6qXiBbQreyIRIEmxWsjaSbB8HtIgE4AAubeQ H6OeK73JYmTaqQ11Eb7ver1ENbv7n1KJywt0XT9G0GHBjqiaP6ZMpRPPAXNI3raWbkCc gi4RIvUk9lflgYwfcsj3Cky4pls3LDwWtGyIScpVgrXGPCmlIdl3clOdX9SNy6oRCjBS MPikXgLGakxl4O2lqH/E4b+DlJYIjEA7GvOCq5BbwaCzZA1vMuKPIrc4m3vbhw6tsT++ PmNw== 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=jPr8P9Yb6cTAfPKz4G37rJkKpt8pjHR2nbgyaSZtI28=; b=qwVgUtoG0OW3Yg/JTtqj5sIaoOEIop2DIHkUigOxn+J2g30TRhubruMqhCpodo7lWC sCErdUV5qxVbdFWLK28mWDZNxyEtvTxb+Qp7Dn7To6eR0O1cfEDXt5tG8yguByhuS2ZN +Hb0s+sM30dTHQrYeKIUHZEqxPNpuV3PCELU/LogSz4Djb4lS4tEObcm3rWmhdM1wcVM y1xZldRokZGmOXH2JVSkXX91wSbOvB0gR1HPQGkCJrhDyavBLg0S6gbMQmwTZU0dzIcl 4hK/JbLk7FXhF1/pPoX3xe4d3VlM/NSQ9YXchkXDSErf/IiO1dtYhoFBdoUeWa35CCwW 7pWw== X-Gm-Message-State: AGRZ1gLGMrP3D6AcgeQ6rHAelgWUx9uDa8H34mWh/2pBr7Zzr/LJ1r9A G0B2cHRpdRTVfiOJ/xjjpuvUPi56c0ol/2+Z77LJmw== X-Received: by 2002:a9f:262a:: with SMTP id 39mr7150912uag.13.1540854286301; Mon, 29 Oct 2018 16:04:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:f492:0:0:0:0:0 with HTTP; Mon, 29 Oct 2018 16:04:45 -0700 (PDT) In-Reply-To: <20181029192521.23059-1-dave@stgolabs.net> References: <20181029192521.23059-1-dave@stgolabs.net> From: Daniel Colascione Date: Mon, 29 Oct 2018 23:04:45 +0000 Message-ID: Subject: Re: [PATCH] fs/proc: introduce /proc/stat2 file To: Davidlohr Bueso Cc: Andrew Morton , 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 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.