Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3591041ybf; Tue, 3 Mar 2020 08:40:08 -0800 (PST) X-Google-Smtp-Source: ADFU+vv72PvbgH7YTtnjzqmPGbM0zDhdhrfdFBx0mVJfNaNjDXHIzG8WVbdTCC8VUFWrfC+Vq77U X-Received: by 2002:a9d:c63:: with SMTP id 90mr3759922otr.330.1583253608015; Tue, 03 Mar 2020 08:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583253608; cv=none; d=google.com; s=arc-20160816; b=d+Pd0AXcqAf2OHUB3RdPGIddwrBLnc6UT++E3EVs2rzyAMAA4/Y3H9z5SMmISz31nd 0vv030FLRPMOsGC9RwlJmumpUeg8kMBOQie/A4WTJnI52VniYGG6xARPyTPgW0nQbKHM uKsBq/DjRh4dBBRCpcbQrpOJlXDN7ovBZzS24uHQUKd2awpHpQsPT+kWL4L6b6IKdF5Z tip8BdqBos2rCaQnQrilb2uhAfWbVCQHMsB7YJuY1hp8NeCu7SKDl67NILuHUuaZqJe3 oLKKMgs9mxEadX4nErEc+HCMrgddT/gt0F3mube0OBLMBiDkdVKsyG9dfOZwdn8Z5qle ZEew== 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=mc4DlEzcdhV0Yu+NTp5A9be/xxbMr/G1l/DfgyjXFmA=; b=dBrFNc4amIeCqV9EOHuf7s4YmP8Uf1dPar5JRi528+kMW9epS8lkAXzhDCiL+mIxku b1pc1r/eCdzEWhmot9mcN/uKwz0dJ/esK2MXSSxFW8TnhA6fWSvm7NNxdpY0bwHj0AwZ KDcSWcQtDetDerlYsAAthPb9or538eOy8Xm0WmhjKkmpJRm/s/nRwXSB/uq1w5hniRbi qnd1kNCk0hUEfdxBKEbnihmDKmd1/bVkU9fcGHMPl7FGQ3uGkydETohB2r0YDwpGOuNQ b/Mg0udVHgtEKD/8i2FFCkor/jOD9nKsTtm7+XhbzkQfju6EzH3/ogWxMKow+WUOmc11 UmhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HOe5cKde; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si4147010otq.237.2020.03.03.08.39.54; Tue, 03 Mar 2020 08:40:08 -0800 (PST) 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=@kernel.org header.s=default header.b=HOe5cKde; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730422AbgCCQhl (ORCPT + 99 others); Tue, 3 Mar 2020 11:37:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:47142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728497AbgCCQhk (ORCPT ); Tue, 3 Mar 2020 11:37:40 -0500 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 2CCA6215A4; Tue, 3 Mar 2020 16:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583253459; bh=FhA4AlKsWQhkG5239jPG/L5X/SEVz0vTQkckZ629mRs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HOe5cKdeZj3pXjYZJc7DPIkoB9zGWLNL7+2NnUcWRx9ffmsug7aZyoV7LPfLhWOoC r9tJFI6o/X6MQsFS6oLoPVIPKnbXxMsL4Ngwshfy+4RqnWnahiwc6QbpLA6WVXLHTN QgYNYzypKh9HPTjpdL9nEQm+cDk633CduZf5/X1s= Date: Tue, 3 Mar 2020 17:37:37 +0100 From: Greg Kroah-Hartman To: Jens Axboe Cc: Jann Horn , Miklos Szeredi , Karel Zak , David Howells , Ian Kent , Christian Brauner , James Bottomley , Steven Whitehouse , Miklos Szeredi , viro , Christian Brauner , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] Message-ID: <20200303163737.GA652754@kroah.com> References: <20200303113814.rsqhljkch6tgorpu@ws.net.home> <20200303130347.GA2302029@kroah.com> <20200303131434.GA2373427@kroah.com> <20200303134316.GA2509660@kroah.com> <20200303141030.GA2811@kroah.com> <20200303142407.GA47158@kroah.com> <030888a2-db3e-919d-d8ef-79dcc10779f9@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <030888a2-db3e-919d-d8ef-79dcc10779f9@kernel.dk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 03, 2020 at 08:44:43AM -0700, Jens Axboe wrote: > On 3/3/20 7:24 AM, Greg Kroah-Hartman wrote: > > On Tue, Mar 03, 2020 at 03:13:26PM +0100, Jann Horn wrote: > >> On Tue, Mar 3, 2020 at 3:10 PM Greg Kroah-Hartman > >> wrote: > >>> > >>> On Tue, Mar 03, 2020 at 02:43:16PM +0100, Greg Kroah-Hartman wrote: > >>>> On Tue, Mar 03, 2020 at 02:34:42PM +0100, Miklos Szeredi wrote: > >>>>> On Tue, Mar 3, 2020 at 2:14 PM Greg Kroah-Hartman > >>>>> wrote: > >>>>> > >>>>>>> Unlimited beers for a 21-line kernel patch? Sign me up! > >>>>>>> > >>>>>>> Totally untested, barely compiled patch below. > >>>>>> > >>>>>> Ok, that didn't even build, let me try this for real now... > >>>>> > >>>>> Some comments on the interface: > >>>> > >>>> Ok, hey, let's do this proper :) > >>> > >>> Alright, how about this patch. > >>> > >>> Actually tested with some simple sysfs files. > >>> > >>> If people don't strongly object, I'll add "real" tests to it, hook it up > >>> to all arches, write a manpage, and all the fun fluff a new syscall > >>> deserves and submit it "for real". > >> > >> Just FYI, io_uring is moving towards the same kind of thing... IIRC > >> you can already use it to batch a bunch of open() calls, then batch a > >> bunch of read() calls on all the new fds and close them at the same > >> time. And I think they're planning to add support for doing > >> open()+read()+close() all in one go, too, except that it's a bit > >> complicated because passing forward the file descriptor in a generic > >> way is a bit complicated. > > > > It is complicated, I wouldn't recommend using io_ring for reading a > > bunch of procfs or sysfs files, that feels like a ton of overkill with > > too much setup/teardown to make it worth while. > > > > But maybe not, will have to watch and see how it goes. > > It really isn't, and I too thinks it makes more sense than having a > system call just for the explicit purpose of open/read/close. As Jann > said, you can't currently do a linked sequence of open/read/close, > because the fd passing between them isn't done. But that will come in > the future. If the use case is "a bunch of files", then you could > trivially do "open bunch", "read bunch", "close bunch" in three separate > steps. > > Curious what the use case is for this that warrants a special system > call? All of the open/read/close cycles for sysfs and procfs files were the one reported use case as we have lots of utilities that do that all the time it seems (top and other monitoring tools). thanks, greg k-h