Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3548577ybf; Tue, 3 Mar 2020 07:57:50 -0800 (PST) X-Google-Smtp-Source: ADFU+vs4VREV+tDnyrX5oAUfcaVV9sbc+4yv79BMa/JPv01HRXhfV75ut5kd9VwYUhpeNuStr64f X-Received: by 2002:a9d:3f5:: with SMTP id f108mr1478694otf.131.1583251070120; Tue, 03 Mar 2020 07:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583251070; cv=none; d=google.com; s=arc-20160816; b=amcCaiMS1uLE1dyfUKdoWsqk3S/e7soUlAsr2U59HmYcZIePbwSy/k+sN9pVSO/y+C pgJM2VMabPpf6DUWE8xHzuP2SKN6y8KJeJ7YM0YuSG6qRhQN9SnaM0FmPAoE12/aSMlU fc32MBzlgHPi2O6dFoXS1IWAjxqa5GP0Xzxg7UvggX1Cs6sGbB5bB0FkLE8IQbWOzilr w79BQk7ipGl2ryeKIzupkhLVAXZh/k7XkdpfM8gW5qGk1NDb4SarrIzImCz8y9+2CwYi 525fQnZEm/rUVwH3Wa+bX1Y0IGYk9m6j1aw6bHwW47P6rPhybT8zpDrYI5R8zKaIRwYr 7BFQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ZG+Z5PlJjVm8PVRrvVFjKYG60wCcDQJcM/cIXR7GgWs=; b=CRzR1Bm0nW9VEzjC+FIlVbMOC9JyRws6uQX6lOSb5DDPVXJCwu2HjnEzAbaPOo4s4P DShcCv1GXPOg/4bL/RZKw2jniiIxV9B11tcp8w8x7VRsH1k8x3nVMN6ZPTwBF4PtU/yE M+zoHgJgfb2UXIXL6Lj82hCBlA0r/BjeYXpEyWfaVR7CpM2DuxoSr9a0mqjA7bE32uQs TEMAyuNlQGhb8sNviXCwLEotEWktEIAIuTKVAUmHnFsKzdO3JmTCqxEm2eW7P3y2Zjiz MRjvEE8Om2RrABWS/FwXjQaUpjHAbt3fJKWKdF4nBtGOi+7UK5krsNa0RLJcpu3RviRc jpaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=Lz3S0tth; 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 s15si1135212otd.209.2020.03.03.07.57.38; Tue, 03 Mar 2020 07:57:50 -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-dk.20150623.gappssmtp.com header.s=20150623 header.b=Lz3S0tth; 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 S1730151AbgCCPos (ORCPT + 99 others); Tue, 3 Mar 2020 10:44:48 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:44993 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbgCCPor (ORCPT ); Tue, 3 Mar 2020 10:44:47 -0500 Received: by mail-io1-f66.google.com with SMTP id u17so4012825iog.11 for ; Tue, 03 Mar 2020 07:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZG+Z5PlJjVm8PVRrvVFjKYG60wCcDQJcM/cIXR7GgWs=; b=Lz3S0tthIYaC3IENsF36JWiCsuLYH86LS7/c5LNNFUEJdwftjJ3tcQmCn4mVtCUG+o XseDzhB4vzz/3J+8RSvuHvNBmm78EbXQEYUrGpskbzlT0lU51zA5VhjKVW5EOc0mrWso QKzxShqhorVF33vtLXFwI7HEZoQD6SVTfR//8ia1gWa4HyuJ78V1DbQi8ljs30PCwUbL 5urcNDkfNkyj+1/5qRoCUz1PYUOcI0v1EQRD4tP5gftHukoNMnV8YNXLdD4VL64vaRFr IiTgTTZWvn3m3Iyr38KQDBs8ijMhd/Xl4ltF3hqoGqwJ3s0YIl5rWElbuumej2uE3WFV aqiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZG+Z5PlJjVm8PVRrvVFjKYG60wCcDQJcM/cIXR7GgWs=; b=G57sPdBHGkzhT3ib3puGrYnE8h6fpSBvAJuJU1hBTbJfgj2AFnVmL40roJ22w/+HYF 0vAR5SQl4y1FSONmqZX/poD406wx5T6oKdapO8Wc653adGdSgMzRN4pNcJCskwkIe8Ne tHBCGdcVayBwnCu6CsrL8cpdk/fFLL8lmnMbH9tZPC1J2h0BlthY1o9ZVj9IBJU1NP03 M6fnuaaDMaV6bO1X93n/Cqk1MoVKUkWohMPFyjKHiGok8cJU2cpkoc2phk9fhhiJUG4e 70NyvHKA+wuw7oL03YAabw3vu6dPiF4VkpA65USxZcfa6Tjyq0+UGhOHmMzBlKzQqZZ9 t66A== X-Gm-Message-State: ANhLgQ1PX53xha0DH6b3vB9BpzM7uEirlHWzKw2jI09VhYTwt2R7S5zb d6ZclI1/qwqdawjxmdNnNWnhcgAru6I= X-Received: by 2002:a5e:c207:: with SMTP id v7mr4350463iop.88.1583250286473; Tue, 03 Mar 2020 07:44:46 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id e65sm8011244ilg.2.2020.03.03.07.44.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Mar 2020 07:44:45 -0800 (PST) Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] To: 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 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> From: Jens Axboe Message-ID: <030888a2-db3e-919d-d8ef-79dcc10779f9@kernel.dk> Date: Tue, 3 Mar 2020 08:44:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200303142407.GA47158@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- Jens Axboe