Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3152527ybz; Sun, 19 Apr 2020 19:08:53 -0700 (PDT) X-Google-Smtp-Source: APiQypLrk/r6b5MV2H8GjULlTlUIKYhX6MHuANpoHGKHEYsOMcbx16/Z75yCgbGnPriDcFdurD6z X-Received: by 2002:a05:6402:b17:: with SMTP id bm23mr12736701edb.137.1587348532924; Sun, 19 Apr 2020 19:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587348532; cv=none; d=google.com; s=arc-20160816; b=pRlW1b2KXjmnDm2aiqXx3JRBb7iCAk79XIVUWrVrkJbCl9cZSR3fQctpmlbQdts1vy DQMzpIfCZ9TS1v1+WMxM31Dl0TcbCIkA59e3yjtWNxsdRx/sFW+6vqgkrSafraut3CbB sivNDhQqu0j/Xe0TsVSFNoWw61aZNWar+SpKRNi7QcBTE0EuSUerJ3aJ/E7InchsBQWd mi01V3yvwdwEKzvp6WY8noQCk03r9ihtUPfNSJt2Qn60JZJc+Qkuof97vZ2ZQmil4v+A 8+UEMkeD4zZEM557nJFd6cU5wKaQ7o3B8JQ4lMuMR0n2cV2/I7hw63k0tk1h9HV4PGpS BEVw== 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; bh=RjpTW/pWSd3MxdkqzYz8PyHp61U4ggVXamLkLpQreJQ=; b=AoHTVxnJVp2ttX5pQdF7BrGwajVtK0MXf1T6GSWS50g8L1WWMGtGZ985592tC+knLq uXcbrfAmbg827TrW1k9JIqGLSEu2jFNMtIv29K/j9mTr3oJzcbfJVte1yOe3z7khTnGp 5r/5LWRbfdNuyD55YCU41RPEywrL8HTlyjUy1m8dZKlREs6XGHlf+Og/VeWGdTuooWMB 2s5gU0pIb9fBAQcBUFwDoHKWC3ejPmDw10WVA2vHSsElp+GXX9zMj1FDtYL2Oy7inJyU Mhsh9MNxt83DpxooTBygiY1F32JRrhr8/TG6F++TogCu+726xp1j5txGg/nCwSfIyiB3 gcxA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nh7si12760481ejb.182.2020.04.19.19.08.30; Sun, 19 Apr 2020 19:08:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbgDTCHA (ORCPT + 99 others); Sun, 19 Apr 2020 22:07:00 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:46500 "EHLO mout-p-201.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbgDTCHA (ORCPT ); Sun, 19 Apr 2020 22:07:00 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4959755FpdzQlCW; Mon, 20 Apr 2020 04:06:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id ViTbMQLm6i7Q; Mon, 20 Apr 2020 04:06:51 +0200 (CEST) Date: Mon, 20 Apr 2020 12:06:42 +1000 From: Aleksa Sarai To: Jens Axboe Cc: Josh Triplett , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, Alexander Viro , Arnd Bergmann Subject: Re: [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Message-ID: <20200420020642.xzkqikia6kmslkjh@yavin.dot.cyphar.com> References: <20200419104404.j4e5gxdn2duvmu6s@yavin.dot.cyphar.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nl3aoloccd36jfpc" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 57B701756 X-Rspamd-Score: -8.16 / 15.00 / 15.00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nl3aoloccd36jfpc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-04-19, Jens Axboe wrote: > On 4/19/20 4:44 AM, Aleksa Sarai wrote: > > On 2020-04-13, Josh Triplett wrote: > >> Inspired by the X protocol's handling of XIDs, allow userspace to sele= ct > >> 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. > >=20 > > 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)? >=20 > io_uring can do chains of requests, where each link in the chain isn't > started until the previous one has completed. Hence if you know what fd > that openat2 will return, you can submit a chain ala: >=20 > >=20 > as a single submission. This isn't possible to do currently, as the read > will depend on the output of the open, and we have no good way of > knowing what that fd will be. Ah! I was aware of io_uring's chaining feature but thought it had access to the return of the previous stage -- now this makes much more sense. Thanks. --=20 Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH --nl3aoloccd36jfpc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSxZm6dtfE8gxLLfYqdlLljIbnQEgUCXp0DrwAKCRCdlLljIbnQ EmOYAP4lkf0v9STwr5KoDYWT6PbyBkxhHUVVy9D52d30Gd/h6gD/eZQuaYg8dEjF EJpgo1J1EPiK6PIgD34KjQNKv8C7fQ0= =hBJk -----END PGP SIGNATURE----- --nl3aoloccd36jfpc--