Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4421738pxa; Mon, 10 Aug 2020 08:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6jF33mNKadm8mOy/IsfSbav9mzpRI8+QK5mt24rJR1bcrqjePWRWP3s0/VN+PAFvfyLH/ X-Received: by 2002:aa7:c70b:: with SMTP id i11mr21149362edq.272.1597074138125; Mon, 10 Aug 2020 08:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597074138; cv=none; d=google.com; s=arc-20160816; b=rqqLHOIFKQ4ZgD8FJGrdfHAUdy8PGOJIbpEFNearCQDz0VZi7PzrlHWVRHqIzaGiLz XFTGo9wn+pJgjiQ0pYoQctSj4miFI/FNkqdgyIEas5YoMzprLSw5bd5Ce+QdMzbalV5K NkpdPn6DK9OHLbtx3peNUQdEmEeGxKEqNBC73SIyw2V0zrSD8wecmUrp4dDRf15lVPSz 9eREbQazFib8m5VrthjpQgwUP1Ck7AwD+EXEMj278gFm3T7QTdgfDuidl6UbzE+I7QcD JN2WSEzNVgzlMACxcE32eoDExDyKBN2U0Rhfzd2lAz83Mia8gU9szSXnx+gIwyZvy2c2 Qe9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=j12sQIK3+BPE/SW9cZVsCqzLxi+GtmWMfbc/YF+oRI8=; b=OR1sP7+bGyyGF1nh+2d5is4LGCO0GuKm2qPvKMKIIFo3S3vpuZ8uIiEhw4lWbB3gga fLKVei+FEI9RxRLtOVcyKBrsNYYWUFHj1tJIXYIircjkFGSGEa8azxdZ7NjcM+U2wq5a hxbpym1E5dhg/k6PHGnn9X6AvuypwLI3JsVzQFTvvhYwHebM9NX5JoCydXEKRXCF5YhX O0aucm4UeqrtjuZhioJ9WBEn/1B7X2a0+rDMcRQZBs2DHzRVyVBp/bmJPMSxJS4Hl7WQ Tv4Y+jJBSgl8qJ8hXg88M2/kyZa3m6m7oBTs3IBCq3HbghgLnRxaDL52O2zYyQwZEaKz XOZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FnzRu9GI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si10486724edv.45.2020.08.10.08.41.54; Mon, 10 Aug 2020 08:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FnzRu9GI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728456AbgHJPl1 (ORCPT + 99 others); Mon, 10 Aug 2020 11:41:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:53242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgHJPlW (ORCPT ); Mon, 10 Aug 2020 11:41:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E123420774; Mon, 10 Aug 2020 15:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597074081; bh=/DZI2CFBXPZXY6W2D41iKfNlsWTLOnIsj8qhKNBhXyc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FnzRu9GImI9oEyDWHQAcntUlob1mf068CGlKWLj/oKXM7dkyIU9SLC12tkja3BnsT n2FUkDjXa/QIF0ivhbsZFXgkn6CmJyJaK/GQhtEx1N6TZ8wpLHSU1No/9ZcbQWCnnD vQwOK+h0ldJSALe1FJ9TNCb9dImTC6q9cE1JKX+I= Date: Mon, 10 Aug 2020 17:41:32 +0200 From: Greg KH To: Eugene Lubarsky Cc: linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, adobriyan@gmail.com, avagin@gmail.com, dsahern@gmail.com Subject: Re: [RFC PATCH 0/5] Introduce /proc/all/ to gather stats from all processes Message-ID: <20200810154132.GA4171851@kroah.com> References: <20200810145852.9330-1-elubarsky.linux@gmail.com> <20200810150453.GB3962761@kroah.com> <20200811012700.2c349082@eug-lubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200811012700.2c349082@eug-lubuntu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 01:27:00AM +1000, Eugene Lubarsky wrote: > On Mon, 10 Aug 2020 17:04:53 +0200 > Greg KH wrote: > > How many syscalls does this save on? > > > > Perhaps you want my proposed readfile(2) syscall: > > https://lore.kernel.org/r/20200704140250.423345-1-gregkh@linuxfoundation.org > > to help out with things like this? :) > > The proposed readfile sounds great and would help, but if there are > 1000 processes wouldn't that require 1000 readfile calls to read their > proc files? Yes, but that should be better than 1000 open, 1000 read, and then 1000 close calls, right? :) > With something like this the stats for 1000 processes could be > retrieved with an open, a few reads and a close. And have you benchmarked any of this? Try working with the common tools that want this information and see if it actually is noticeable (hint, I have been doing that with the readfile work and it's surprising what the results are in places...) > > > > > > The proposed files in this proof-of-concept patch set are: > > > > > > * /proc/all/stat > > > > I think the problem will be defining "all" in the case of the specific > > namespace you are dealing with, right? How will this handle all of > > those issues properly for all of these different statisics? > > > > Currently I'm trying to re-use the existing code in fs/proc that > controls which PIDs are visible, but may well be missing something.. Try it out and see if it works correctly. And pid namespaces are not the only thing these days from what I call :) thanks, greg k-h