Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2972035ybz; Sun, 19 Apr 2020 14:20:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKOStzRr8Ys/LVzDXCublN6dxNQlB/G2Cut+9oV5RNMg/7q/WltgzM8TIi8+3B3h6E6IlSj X-Received: by 2002:a17:906:6856:: with SMTP id a22mr8941985ejs.115.1587331246690; Sun, 19 Apr 2020 14:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587331246; cv=none; d=google.com; s=arc-20160816; b=cacsIqGq+OzPQk+RZa/gvYH+hK3guTIPDWQ50qwbbUt3XoFeQb75cTmfuMX/xvqHBW cl0zOEU8NX7E3eTrDgiZsfPoZQCafLF2v6UgdWub9aic46Mfvd64ZRjAJjWih6TRTsoE rCsEB1CNzXti2KgjGAIcEjV0j+KUv6Yi7X4IHah+LRjH/UXeb6+qhT4XJc2Ww/RBngW0 irNsm+Or6hwiAnr3Ovw3TrWWXf0HsEkM825uaKJIIQ9klflibhRD+H/55w7niuvnNSis SJAdUQKFxwaMly62rTLu5DWIWkCh6hsz1ABH/fpnTwIEj+QjnkYlEFKG2n4opSNJsnbu v34g== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=LLDgoq5izlSCC07yXvlbg/PlPgNpnHMZ43LjGlYY4Yg=; b=HBoXN9vnMeMrWa8w5tB0pmtg8+b/O7+EX5dQuV/+5yWNdWbe6aXO5PMClJUTbImcSJ BOHCvWYxJtXpvSVMrYvx75bHx5rcenwYWxh2P/YpVeG340J8RP0XamHFtCmt0X/ONkOt 5BTczApFppRbw8H3/YlYOX7ZD5bBhKdrKEyvV9DbsZrcfEt1IIA1co4JDlf5hEGXJE48 s7jJq16VetALGpWbhE8dVOWDNPvd1M9lZ14OB0LHMSOx9vhZezsyiWbIkTd9NNWZsunk kY5i/n+wBnZ5zi0s/Kf+2znNgKYGEBvM3VQ8cymOyY+i+X3cVQD/YtAKrXVBXjabEpM6 uIVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si2698590edy.201.2020.04.19.14.20.23; Sun, 19 Apr 2020 14:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725988AbgDSVSK convert rfc822-to-8bit (ORCPT + 99 others); Sun, 19 Apr 2020 17:18:10 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:29583 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgDSVSK (ORCPT ); Sun, 19 Apr 2020 17:18:10 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-196-qkGxLyqRNSu7MfwxJtx5NA-1; Sun, 19 Apr 2020 22:18:06 +0100 X-MC-Unique: qkGxLyqRNSu7MfwxJtx5NA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Sun, 19 Apr 2020 22:18:06 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Sun, 19 Apr 2020 22:18:06 +0100 From: David Laight To: 'Aleksa Sarai' , Josh Triplett CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "io-uring@vger.kernel.org" , "linux-arch@vger.kernel.org" , Alexander Viro , Arnd Bergmann , Jens Axboe Subject: RE: [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Thread-Topic: [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Thread-Index: AQHWFjeEcgUetSiAV0WbnffNc+KTs6iAvc2Q Date: Sun, 19 Apr 2020 21:18:05 +0000 Message-ID: <7f02bf52254443e380c33cae7c1fd5f0@AcuMS.aculab.com> References: <20200419104404.j4e5gxdn2duvmu6s@yavin.dot.cyphar.com> In-Reply-To: <20200419104404.j4e5gxdn2duvmu6s@yavin.dot.cyphar.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aleksa Sarai > Sent: 19 April 2020 11:44 > > On 2020-04-13, Josh Triplett wrote: > > Inspired by the X protocol's handling of XIDs, allow userspace to select > > the file descriptor opened by openat2, so that it can use the resulting > > file descriptor in subsequent system calls without waiting for the > > response to openat2. > > > > In io_uring, this allows sequences like openat2/read/close without > > waiting for the openat2 to complete. Multiple such sequences can > > overlap, as long as each uses a distinct file descriptor. > > I'm not sure I understand this explanation -- how can you trigger a > syscall with an fd that hasn't yet been registered (unless you're just > hoping the race goes in your favour)? I suspect (there are no comments in the io_uring code to say what it does) that the io_uring code uses a thread of the user process to sequentially execute IO requests that the main application has added to a queue. So it might make sense to queue up open/read/close. But that ought to be within the io_uring code. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)