Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3845669pxp; Wed, 23 Mar 2022 06:54:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj+ToMUVX/Pp1BL1GKw97FBsU5Sb0TaFCrD3AblzYJuRRocJvTqRXeYPwGgQTlwK3/EiXa X-Received: by 2002:a17:90b:1bc6:b0:1c7:3229:652a with SMTP id oa6-20020a17090b1bc600b001c73229652amr11939811pjb.65.1648043681766; Wed, 23 Mar 2022 06:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648043681; cv=none; d=google.com; s=arc-20160816; b=nUDL7v5TilIsWK74HmQA+vIwmbSWPwxRK5oJDSg4m5qjCzEuH8TQsUHTc0gRtHzQWh dMm+SnT5jPrtzfclYh7/+ldoJe0V6/di2tz4Ku3KJt8tpRfGh+DWmAbRAvIU6QjtK/y/ XRFZA2lPof1WN0NRwu/HZv3Qd8NSyLJRLp4TLNxBxWjXM52tWRuaJZkw0mCir1I2lGDq h71/yL5vT3AjJJnvqgCxmRQklFtIUXSfRlmhO7TUAiYuRglKjMZIMTLzWCB8CtnDvLz9 DbzVh9oXaKkM7G/y8XlS7/ceMngQWwIsPcqaPW6FW/hNmmt3IPwIXlorGITaoWekaw3v FSvA== 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=xPmutrLy6IpyytPLDx8R6sM7QOBjKwzD7zjy2s4ui+k=; b=DV6sBOqxFqLvV+L7tuhtHkH2jW61MRfU71/qDm0CsLauXzu6QYSBZxY1pe8A7UPV42 tGctbNNXfIrBcDGu0IYW86pPaoUrgx+ZSX/WqQr60zVPUqSrkQn2fdSfvBXBE86OoZdC lKDe4VzpbwVLC7ydR8YHwREIVjk4T6u/Z8sKAjp25DnsQWr+jPstdj5EuY5QP1CScjad dSAbp/jRNqfv5oPLaguknjs566olPqYvh4+06uRavTKphPnaC5bn/oveew+NpEn1GI4i ubuw1mt7WfSS5jyy/xpsJuZRnMXVOiJj1yHlD1esYwROuR517JIIOM+mLY+CWXGuL6yY XWIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QLEWpsMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a170902c24100b0015408026bbfsi16297727plg.309.2022.03.23.06.54.23; Wed, 23 Mar 2022 06:54:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QLEWpsMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242087AbiCWHPo (ORCPT + 99 others); Wed, 23 Mar 2022 03:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbiCWHPj (ORCPT ); Wed, 23 Mar 2022 03:15:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EFC76E8C6; Wed, 23 Mar 2022 00:14:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D3F5461614; Wed, 23 Mar 2022 07:14:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C96AC340E8; Wed, 23 Mar 2022 07:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648019649; bh=hmXlP/3KkYC9olmjEpmQ0hcW/3wqRHuMgj5g8NhFibk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QLEWpsMnuvyQEqlQjQNNG92zDvh4BjRB7deVjeEnFYaRt3cqwUxEu/ekQT1nNzSgT DTqt9566RSHNzKs+nZd43aDmjj6KWy00QRVM7B3j+XLgdh44BzzlpWB11QBH/ltgWa t0MEJg07DGYGWogi2mK1ptQ1gAft/XwvlNuM5Q94= Date: Wed, 23 Mar 2022 08:14:05 +0100 From: Greg KH To: Casey Schaufler Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Mar 22, 2022 at 01:36:26PM -0700, Casey Schaufler wrote: > On 3/22/2022 12:27 PM, Miklos Szeredi wrote: > > Add a new userspace API that allows getting multiple short values in a > > single syscall. > > > > This would be useful for the following reasons: > > > > - Calling open/read/close for many small files is inefficient. E.g. on my > > desktop invoking lsof(1) results in ~60k open + read + close calls under > > /proc and 90% of those are 128 bytes or less. > > You don't need the generality below to address this issue. > > int openandread(const char *path, char *buffer, size_t size); > > would address this case swimmingly. Or you can use my readfile(2) proposal: https://lore.kernel.org/r/20200704140250.423345-1-gregkh@linuxfoundation.org But you had better actually benchmark the thing. Turns out that I could not find a real-world use that shows improvements in anything. Miklos, what userspace tool will use this new syscall and how will it be faster than readfile() was? I should rebase that against 5.17 again and see if anything is different due to the new spectre-bhb slowdowns. thanks, greg k-h