Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2213816pxb; Fri, 25 Mar 2022 13:10:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlGukIRvv90zAcCp7koc/V35UkG67r+NIBAg8QI/ZBLuFOqaoDV6qsm9xZvSGH+HyeOLUg X-Received: by 2002:a17:90a:1951:b0:1c6:2fa1:d83d with SMTP id 17-20020a17090a195100b001c62fa1d83dmr14600864pjh.116.1648239015995; Fri, 25 Mar 2022 13:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648239015; cv=none; d=google.com; s=arc-20160816; b=qBD/C/s1v4DbfBXT0KefAh9jNQTyVObf1VlgGAxIxa+e9JR9jro1/e0hBen+rwCLAq K7S/S931dFlRPtx6lV+v5Or2RLvMrZKw5xAlhUK0bD4D8F18UbyhmDNn/2fg66+o7NuD hz0dULN1Xsw/qi7sYdt05R3C6oEO8s9bpN7hLDszswKzCysvX6KzJLd0u41ASRc5DZHF UdEDLhM1++DInjMqVHf+EZmcd++Ew+sP3bW4Y6L9d0Ua+vPX/JI1XfJj9qWBIDk43/Qf Ye5eHAmYtNjHAzzUa3XuuxJ1v3icFOJSMnWvdiDgOPv8eGzNysDLOMJCx1HMof6KVA66 44KA== 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=Ct4y/2vagTEoL5DgWAoLz+jJ6PVTSzZLkKcuQNOy3tk=; b=vJlFUyQKDT/8iiPjpp95Kyr5QJLJJd3ypYKxamcvT+mqI0Vw9MvIyt4ESvrrgTulm5 F5oMtTvnYfVYV/oaFbWsSVfKM3yprqwWPQCVRcJwauNJBUnfs0b2b0nvuWk333j0+fWq EH+BO/1ElB8rfvrTwaSpbMALmIXeqfLylsaB6ZsfiAgAS0sx9Y6xEJCPGD6WvkAm6EwK vunnOWUlWI0OS7TfYq6hbcmtg1mIAbzlT7INcMSJ/ghMOERgBG36bCT5yaqeyh+x4pWn r3EM2RlfFCKmkLvxgq+cD1IpRqaSXXloWGSS1yZRnrO67XhPG5X/J7TKiMHNOxm8LMob pVdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="iX/gIIBg"; 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=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b7-20020a656687000000b003816043ef49si3146657pgw.318.2022.03.25.13.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:10:15 -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=@redhat.com header.s=mimecast20190719 header.b="iX/gIIBg"; 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=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA13C3A1D8A; Fri, 25 Mar 2022 11:52:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356961AbiCYJ16 (ORCPT + 99 others); Fri, 25 Mar 2022 05:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356945AbiCYJ1l (ORCPT ); Fri, 25 Mar 2022 05:27:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78114CF4B3 for ; Fri, 25 Mar 2022 02:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648200366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ct4y/2vagTEoL5DgWAoLz+jJ6PVTSzZLkKcuQNOy3tk=; b=iX/gIIBgBAFJFmYsc7SumuAnIH3k3a1b552wh37n3XyDp0uf+pfx6Tc0TCY5It8QNsU8Yf iHr8ghARlPxUogyf9nEe6Lkmbr3nPRhZE3Umx7do+GyQlzXBeM8ylGKpCiKcYBX4t/ovFH 39ty/CtsB/UTPZgS1h46wGnEp/4WWHc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-2Br8BHt3OfiW6g1sQx0YHQ-1; Fri, 25 Mar 2022 05:26:01 -0400 X-MC-Unique: 2Br8BHt3OfiW6g1sQx0YHQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 976D41044560; Fri, 25 Mar 2022 09:26:00 +0000 (UTC) Received: from ws.net.home (unknown [10.36.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A2A12166B2D; Fri, 25 Mar 2022 09:25:55 +0000 (UTC) Date: Fri, 25 Mar 2022 10:25:53 +0100 From: Karel Zak To: Greg KH 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: <20220325092553.rncxqrjslv6e4c7v@ws.net.home> 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: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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:54:21AM +0100, Greg KH wrote: > 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? Right, the speed of ps(1) or lsof(1) is not important. IMHO the current discussion about getvalues() goes in wrong direction :-) I guess the primary motivation is not to replace open+read+close, but provide to userspace something usable to get information from mount table, because the current /proc/#/mountinfo and notification by poll() is horrible. Don't forget that the previous attempt was fsinfo() from David Howells (unfortunately, it was too complex and rejected by Linus). > 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 :) OK, I'll think about it :-) Karel -- Karel Zak http://karelzak.blogspot.com