Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4027505imd; Mon, 29 Oct 2018 16:41:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5dY2YknCq/9qrKs2U+Lm/OAUpyDdsgr3p+vXUj1zgscwm9lKoODUnqcb13wk4xFhdDWnGeY X-Received: by 2002:a63:7f0e:: with SMTP id a14-v6mr15671155pgd.296.1540856486957; Mon, 29 Oct 2018 16:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540856486; cv=none; d=google.com; s=arc-20160816; b=oRU5fC8G6XmzTlf2hqEghuS8DyN7Kef3aEg86qKyNnRIOo+yV9qNb4n8skKdzUmLaZ oYzFlqRX00ISRFmBOEMu6rx8ESOmA+yYXXna+ybrL5+iNhhRX9ZcyVQx58zUUqkl4cA3 +bYfp9NQQ1c0uiYBwUeXZ+ZNWXE+EK2lR281xL/8jxbQYPPKHvZH/3TxfHc08WOxdwAd O/yIrbJ7YUSwhpspgwq1C+kB54u2XYNBp+2rY2uBILW73C6EZO91Pzs0VrwrQzsCG5hs Y9boPFklyBM+I/aflSucDed2lZnS/+MYnkLfyWttqkqXnR1GhdE0WHqjSnZtv/X/uwEi ss0g== 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=DBo3R1uGRylZH2MKNzXF5f5jJIa6z0Mq6/HFIYMps5Q=; b=uP/clml/ZZv8sywNII3f4ndA9U/+HQOWWgwLYOKMyNGpsJRQPtIWgDwsYvjVPhvxde Y9MD3ySv3rNBytnV6pCjB2S1XLj3O76r/V+fyur3iPJOZoFRf1vVpSs/ytDBEj2o4ZN6 Q2rPrSGa/TB3jjkqd4La75+J84pwDl93A4xish/3XYLgy0syo4TWInDB0oLq1d7/5Dvv WEA1PQKC74al517d+etRMwm2//WSnKgsEIpeY453jJLTOiZUWNgVmYoFzR662+GrSKYZ nm969C/0oHq4TYEavumqBvfiMCxgpQa3WTcPi589F//avaiVGqDzlOvrqSt+EPQ4oPcr 6LWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=liMuj0x5; 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 y15-v6si22964708pgq.158.2018.10.29.16.41.10; Mon, 29 Oct 2018 16:41:26 -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=liMuj0x5; 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 S1725932AbeJ3Ibu (ORCPT + 99 others); Tue, 30 Oct 2018 04:31:50 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:41528 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725824AbeJ3Ibu (ORCPT ); Tue, 30 Oct 2018 04:31:50 -0400 Received: by mail-vs1-f65.google.com with SMTP id t17so3360719vsc.8 for ; Mon, 29 Oct 2018 16:40:49 -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=DBo3R1uGRylZH2MKNzXF5f5jJIa6z0Mq6/HFIYMps5Q=; b=liMuj0x5hW3K6SpyzThckIPblcdVZPW0qfIfxzaAt4FxPdNfGQgbvGYdERDl5GMtgk pZdjGclaRC6tBj7gxPHfw91yAofx1EnWSRUtesDIcAURita0J9j6oRiG5+XwruJXw1Ku gCjZoqFrmNDu3hkxA2fB6mUMZyT8iXjBgEroNmCqNTKbRDnDkoA2Hi8MXt6yj+LJmYu/ Kbx0eGpyvs+DmvGkBC65B5Y8Cic0Vd5h6Sag98ZbEQSNcAId+OHO4hp9Mj+V4Z6RRa+c 1IR96QelUUPSQQNP3sHB8uAb53/WPXzcCTvh/zZDhZlFbrk+MY+eMXyw1KMIjw+NpSXI FUeg== 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=DBo3R1uGRylZH2MKNzXF5f5jJIa6z0Mq6/HFIYMps5Q=; b=oeak+Di3Xg4nL9hFy4Az6Y3h90QvGN7qLbvSopyWGaq5NydjLOf49ow6euJ8jEMrCH TKnBDBAibOHRy5KiDzp5r724oWNjBAgCr6SlM8fmYCUh0frO5aAwR/A08cnkgWVzTMQq dr+ldaI70BxRzmwLfsMQdXb201IPAwDOU2yXUgLGT0hCps6Snk9Zkw+LwPKKZoCz9FXq 5YDdgKOICTBnaZCOe1bWgowbaBUaDe20Hw6fVLnvp1+DvCnHl0kLqCSkVjXWO5ULJSAq 5E9BpRcg6mM0N67coIcuu8l9N7dj8xk5nkHUWV7GUjdJnsSH/LLDb92mtnQs6aYFVash a0lw== X-Gm-Message-State: AGRZ1gLSsny0UjL71rLJFfA3Y8JXGbZoToUAtL12OlK39vzhUJvLrAUX r9Si2l7pwRB960dJFhHgUY9ARVd6mqLg3r+ZsAC2NQ== X-Received: by 2002:a67:6cc1:: with SMTP id h184mr2201108vsc.149.1540856448113; Mon, 29 Oct 2018 16:40:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:f492:0:0:0:0:0 with HTTP; Mon, 29 Oct 2018 16:40:47 -0700 (PDT) In-Reply-To: <20181029233414.GA29750@avx2> References: <20181029233414.GA29750@avx2> From: Daniel Colascione Date: Mon, 29 Oct 2018 23:40:47 +0000 Message-ID: Subject: Re: Re: [PATCH] fs/proc: introduce /proc/stat2 file To: Alexey Dobriyan Cc: linux-kernel 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 11:34 PM, Alexey Dobriyan wrote: >> 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. > > You've just reinvented systems calls. I don't know why you say so. There are important benefits that come from using an ioctl on a proc file FD instead of a plain system call. Procfs files have file permissions, auditing, SCM_RIGHTS-ability, PID race immunity, and other things that you wouldn't get from a plain "get this information about this PID" system call.