Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3600263ybf; Tue, 3 Mar 2020 08:51:23 -0800 (PST) X-Google-Smtp-Source: ADFU+vsqoEu/lHzc21nLMmmZjBd/4ktbAezrt6cJYaM6ye1tJXPLi4obvejw8n+vlIFwY6ARNLA9 X-Received: by 2002:a9d:7c85:: with SMTP id q5mr4146890otn.341.1583254283641; Tue, 03 Mar 2020 08:51:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583254283; cv=none; d=google.com; s=arc-20160816; b=L8qPs4DSAeWVXSoFRvHwHYe+0bGiy28HIvD8Dx2h3ayU2ck5uUnR2bXEEJFFdwi7bz Y/mnUoRAN3Z69h8FYqwne9k0HgFwU6W65EVAbnm3+thuU5RcmEgqQJNHmv4VODIKLY/v m3g9uAKCyUYRtqyRth85FfERjSeKO418R3T+JbnIeH6KtTjaHOD1ffEFLAc2NOFKX2Bo 279Qg2iQo2B8aKvYSn7FHPjqk+JKQq01mP3gXa4K9W8k54K/OPUZCWRJM1evgTgc/tCA 468KpE4wCYhN2mWVhDVfe17F4MxlWLA8AwUsZrbYKN5EhTYGHnCzQzaEZs3B6O1MDTLq rbZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=auCWFQGmk0w0q6CUle5zbb9CnS9Fa98tAnwpVhOsTVg=; b=RXH28oky4c3AxfHSi1Q+cu4TM5WpPqTZQpwrXsWMjGvtKYqFsrGGKO9bwAM+zjaCc1 jc35IVM+IvPz6H/dvgcIc/briS8f5cSFX1odaA3aK+QCpz2W2VCYqNYvLacsbdBlW4lQ awk4klOyX7zPpUIOaCQq+XnqPt/JcxKt04GHDtfnYje4B9E32zyRhAhkZyiQqAisATSM /MLcGsGcmQPO2QhO9lLLKqcnKf7ozFQy4MhnXjQlPXgOn0iki4Pg8Bnm5di5ysZZjqDS H4SJtrDye6x5xWC6YosKviGaXTpHUihRFc1V/zeYFqDJM3dN2fSAcID6LckQ1AejmSvH 7waw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ORgqnXKI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si8653822otp.4.2020.03.03.08.51.10; Tue, 03 Mar 2020 08:51:23 -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=ORgqnXKI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729755AbgCCQvF (ORCPT + 99 others); Tue, 3 Mar 2020 11:51:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:54108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727507AbgCCQvE (ORCPT ); Tue, 3 Mar 2020 11:51:04 -0500 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (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 DE9BD20863; Tue, 3 Mar 2020 16:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583254263; bh=E3YuWjLi8CFv4x/taRFjxRmhZUj1cjoEOp26VkTIAyY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ORgqnXKIIEGgZy1ibtF5cMGTJyuUVhpIxPaEn3wqU8aYFM6+1nlyrIhBASiTFP9FV /CQutSWJRviqXOma/n/u0FrItRn/7y1nE0YH3RmBqo4De9orTUI+1zOBRCDfleN8Rt 9ycN6AnOVqNusARwJZFie6zPPu6CbIoMxmVwfjaw= Message-ID: Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] From: Jeff Layton To: Jens Axboe , Greg Kroah-Hartman , Jann Horn Cc: 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 Date: Tue, 03 Mar 2020 11:51:00 -0500 In-Reply-To: <030888a2-db3e-919d-d8ef-79dcc10779f9@kernel.dk> References: <1509948.1583226773@warthog.procyon.org.uk> <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> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-03-03 at 08:44 -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? > Agreed. I'd really rather see something more general-purpose than the proposed readfile(). At least with NFS and SMB, you can compound together fairly arbitrary sorts of operations, and it'd be nice to be able to pattern calls into the kernel for those sorts of uses. So, NFSv4 has the concept of a current_stateid that is maintained by the server. So basically you can do all this (e.g.) in a single compound: open write close It'd be nice to be able to do something similar with io_uring. Make it so that when you do an open, you set the "current fd" inside the kernel's context, and then be able to issue io_uring requests that specify a magic "fd" value that use it. That would be a really useful pattern. -- Jeff Layton