Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2181946pxb; Fri, 25 Mar 2022 12:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMVFxMU6VSVfaSjxzWmM4gPc1Bqq+HtEHyQyvKEFTR60LvQXCD5kySukI+4t8KpwDiXuRW X-Received: by 2002:a05:6a00:e8e:b0:4fa:a52f:59cf with SMTP id bo14-20020a056a000e8e00b004faa52f59cfmr11302999pfb.84.1648236798096; Fri, 25 Mar 2022 12:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648236798; cv=none; d=google.com; s=arc-20160816; b=li9gGVsm6M8HuIooHU1KGbBmJJZ4K356nuvbrW1huubQEj5kZJo6TDPjUFPolNseg0 9bC8nzB0H44lC1rwNFW3p25A3mYKCgLroVwAeqH/1wwYwfQxLa0h/q5J+QMGv2piHSb9 QoJIv/otZq/s3DzUwN3LnAB1erEOP2ZmktOY1hb9BXJ9zryzU6TTQIh6GVeizJxh6ZSD 38VICD7J6kjU35KFKjvNwokLXaNNx6nFZpb2z12NQm7depPKyoFMk4HfuDruEHF8wjpH viY9HIGJESxjVBDc6r/chpCNZhVtZ7flT4nhGm5O0qZhMRlZ1INcFKmz0JlllpO8dE3Z 9LOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FjsEIapvqIy/iSwcBVKp+dowJKohV759PZ428I4GUx8=; b=P086CMRxbVh5vuZQEFjZmhVkJoVhaRoy1sTMhCvhIUafqAC/6OyjSL9YmaOiy9WVwg bnNYyVXhcxa3ZXpBbBcReKPq8L0r6/vVUYa8UV4e8NK/ZfR/gP21MYbV0Yq6HUvJQ3HH YQnJ44PO9HlL4gFgEysgl/Fma2VSp0k10wax9Yj2gWC3/ZE23wA5a+OyzKSTSO/guT/P J3dMvDO5pURVpAhVJkHVPaq9EuGtT+p9hWzpm++TalKHUjMUTqQJDAdxYxMWNDxoF0Gr 5aqyUIglpwqDkLrkVqfypf/VGd3hebJ2Y92bKROcwvswNBfMEzL1X+1ES7xEmqH03kfa kWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wNUhdvTy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l71-20020a63884a000000b0038225bd6f70si3163390pgd.398.2022.03.25.12.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:33:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wNUhdvTy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D603425A491; Fri, 25 Mar 2022 11:25:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355994AbiCYI4E (ORCPT + 99 others); Fri, 25 Mar 2022 04:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354281AbiCYI4B (ORCPT ); Fri, 25 Mar 2022 04:56:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7755F44A2D; Fri, 25 Mar 2022 01:54:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 391C8B824E8; Fri, 25 Mar 2022 08:54:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BD4CC340E9; Fri, 25 Mar 2022 08:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648198464; bh=9hytOMtTOBnafBj5UxposoR8sC86nfCae0S2BSIC3hM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wNUhdvTywTFzC542loW+OvSYeepuTylRZfUgMu8VlO4ChLnSkGn6gkQo/+C8uCDPB TtEavdYBU4LpEwsdAhQpYf0Rmw7I7K9YXr62HghI3C87sh1sQCXrbmt9HG9UhWGLwR t/u9tGCkenb16ERR3bQm1rCaAFCPSf6W2F74R9QY= Date: Fri, 25 Mar 2022 09:54:21 +0100 From: Greg KH To: Karel Zak Cc: Miklos Szeredi , Theodore Ts'o , Christian Brauner , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Subject: Re: [RFC PATCH] getvalues(2) prototype Message-ID: References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323114215.pfrxy2b6vsvqig6a@wittgenstein> <20220325084646.7g6oto2ce3vou54x@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220325084646.7g6oto2ce3vou54x@ws.net.home> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2022 at 09:46:46AM +0100, Karel Zak wrote: > On Thu, Mar 24, 2022 at 09:44:38AM +0100, Miklos Szeredi wrote: > > > If so, have you benchmarked lsof using this new interface? > > > > Not yet. Looked yesterday at both lsof and procps source code, and > > both are pretty complex and not easy to plug in a new interface. But > > I've not yet given up... > > I can imagine something like getvalues(2) in lsblk (based on /sys) or > in lsfd (based on /proc; lsof replacement). The tools have defined set > of information to read from kernel, so gather all the requests to the > one syscall for each process or block device makes sense and it will > dramatically reduce number of open+read+close syscalls. And do those open+read+close syscalls actually show up in measurements? Again, I tried to find a real-world application that turning those 3 into 1 would matter, and I couldn't. procps had no decreased system load that I could notice. I'll mess with lsof but that's really just a stress-test, not anything that is run all the time, right? And as others have said, using io_uring() would also solve the 3 syscall issue, but no one seems to want to convert these tools to use that, which implies that it's not really an issue for anyone :) thanks, greg k-h