Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp521640pxb; Wed, 25 Aug 2021 08:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH9YL0+B9nCLTFS5336KGW5yVJUe4dwtBkqAq41Au+67V286hitoC0VVxZXjdPCrq/4wyz X-Received: by 2002:a92:cb52:: with SMTP id f18mr32564297ilq.120.1629905744793; Wed, 25 Aug 2021 08:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629905744; cv=none; d=google.com; s=arc-20160816; b=JByF/6Zvw/Og70oemMkYMzsWMzPbRdw4lylBiNzV8q+kmI1UEkTEHjIOXF6dRkthhz qY31OQxYveMGI0FHdMCA7ubTo0duws2bMY1uI0mmx/lv9nP1Retcf7tQMLFR7/cvtxzQ dOZriT3v++SRFwWA+JQIDtHwukn9olR5LJp0ucQRrDjnVI+ql9OVQ/XJWDmZWk5pe0D9 28/+raDpxyXZOECLJDT+KU2m1aZd9IpaHnWAEPDGldyNlQhmPPNSyfpS+oQuuT1JepZL rNcnLbVAT6GDGxGKCDqZ+fQO34xmFq6YQZ7b9PPfN+BcSZbi/KRfdhJiGDLTR1t+C+BF 9GfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=iLfJeET2ve0H5UgkAIjYFsr7rtgqOzhLAiJ9vDMCtuc=; b=LBwHQBX8Ky/ZP7UD1evM5vL7knkKdbeDoWQlGVpu8IvruXuRJlQEl9wYpis4Nnluvo TMkSFX2UnjMBWpR2wjf4XJcbCXm1oONGb7WSdC+5PSeummzo7DVEc6t3JSM+CKmfmBKM U3OE7ezFslqudLdwMJk/HV1Zl6CTxrvvDNZieLvWLynSAu+Rxn3euooUlOHSxTNmJuI7 8OtRLX01xhNatpkOcx6dglE4lh80rPyRtdSvdvRaHTx2Zb22KaaQOC0x93U5f2jDuUKS AhXR7P89WwKfnmsCv7DWM40/2Az6BO7uc1KTVU14k7Yq9IL6mu6eIp9kzu1VCCusv/pJ 6J9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=CUXmdc1n; 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 f10si144371ilk.8.2021.08.25.08.35.33; Wed, 25 Aug 2021 08:35:44 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=CUXmdc1n; 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 S241917AbhHYPBE (ORCPT + 99 others); Wed, 25 Aug 2021 11:01:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241901AbhHYPA7 (ORCPT ); Wed, 25 Aug 2021 11:00:59 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40B77C0613CF for ; Wed, 25 Aug 2021 08:00:14 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id a13so31175803iol.5 for ; Wed, 25 Aug 2021 08:00:14 -0700 (PDT) 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=iLfJeET2ve0H5UgkAIjYFsr7rtgqOzhLAiJ9vDMCtuc=; b=CUXmdc1nbVcvgegRerTbifpZts7ufvUAqg4rpm1mItTX8pHSMRcRc9mmAXKW+yFIVM wY1pPZPsIBFqLl+UyJmlupEzWvSp/A4U4NtuNp14vqMeSV/KSvMBzpEb0OPyvOW7Fz2x 7HROreHktuMu366P2mbOrYEcWK2d4g2Kg9fHMqKaRzX9zQXGM2NiGKbv+gRCuFDkWP4E PgKnP/ObMLO+orS3a4Q5jW0kSXGQ8FALoP/geajGrkfu3fS/lneoRgbBcZ9F/1cTkWkD NWNaF9Up9BLKGTzxwQ/zUB/8pzYNuRXM5FdKuUWaxucUhpe9mP8S/D6zPZNiTAP95uiG 4aOA== 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=iLfJeET2ve0H5UgkAIjYFsr7rtgqOzhLAiJ9vDMCtuc=; b=XKt5QM/6CK1A7BZsUSNgZ7afLacUaNXXaLemJ8WktrQZ3KyWpsdRCm/gXhbIOCumfF LNkc/OWpZj4l9gB/pQTj17kBSlm63jGnym1ABJ5E+loijny8dyiDml1SEyRqc9O6g1St dTw4M7ehxFc31ihYB1J+lAc7IimAsffdVFvNR0wYCCZVjBJFZtRpDsqQSkD3xB2CALe3 AI00gC490O5ng7GGz5WOyKiACtRN05O22DfSOgYyI+Z8++ahnxUuj4Y56ZzDG40Zi++K tOgcVfi02wpE/chhWZaSjLSkBBRE+TXanVGqFQ/MijBABny9jd0eolGCykmHvJ5wl3gj V0gw== X-Gm-Message-State: AOAM531ELZGisT3wB7EyUqw1OSKtS4URAG9V4iD4MCn/WWPUE7YV9lzA Ov/B+wemq9Cr+akl55cAO8zc/w== X-Received: by 2002:a05:6602:2436:: with SMTP id g22mr36663718iob.109.1629903613651; Wed, 25 Aug 2021 08:00:13 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id f9sm110864ilk.56.2021.08.25.08.00.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Aug 2021 08:00:12 -0700 (PDT) Subject: Re: [PATCH v4 0/4] open/accept directly into io_uring fixed file table To: Pavel Begunkov , io-uring@vger.kernel.org, Josh Triplett Cc: "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Stefan Metzmacher References: From: Jens Axboe Message-ID: <230278aa-9774-e31f-b4f9-c1785a2ecfc5@kernel.dk> Date: Wed, 25 Aug 2021 09:00:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/25/21 5:25 AM, Pavel Begunkov wrote: > Add an optional feature to open/accept directly into io_uring's fixed > file table bypassing the normal file table. Same behaviour if as the > snippet below, but in one operation: > > sqe = io_uring_[open|accept]_prep(); > io_uring_submit(sqe); > // ... once we get a CQE back > io_uring_register_files_update(uring_idx, (fd = cqe->res)); > close((fd = cqe->res)); > > The idea is old, and was brough up and implemented a year ago by > Josh Triplett, though haven't sought the light. > > The behaviour is controlled by setting sqe->file_index, where 0 implies > the old behaviour using normal file tables. If non-zero value is > specified, then it will behave as described and place the file into a > fixed file slot sqe->file_index - 1. A file table should be already > created, the slot should be valid and empty, otherwise the operation > will fail. > > note: IOSQE_FIXED_FILE can't be used as a mode switch, because accept > takes a file, and it already uses the flag with a different meaning. Updated the tree and picked you davem's ack as well. -- Jens Axboe