From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60DF5C3F2C6 for ; Tue, 3 Mar 2020 16:37:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 365F221739 for ; Tue, 3 Mar 2020 16:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583253461; bh=FhA4AlKsWQhkG5239jPG/L5X/SEVz0vTQkckZ629mRs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Jd2fkcrqBsGd2w6CdPfD0Yv21z7Yd6aHJYmcMqcaactZPsxY1BI8tQYdvHDIBUlFW IFmK8DU4HcT0ZcKtVFEmmYNn9U8NAFR1YbaBo1yY+x1oXiyN2El94UiDYPP42pT4nC hSxVldrnKJfRpA9ABS2tUZUb5fRs2iiLJF2NjIb8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730417AbgCCQhk (ORCPT ); Tue, 3 Mar 2020 11:37:40 -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-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@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