Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5244853pxv; Wed, 21 Jul 2021 00:23:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4wimqsHrYMVErjVgZIPg2V9LPr4zCt1NpzMtmFlJCJAH7P4/c9Ax4XSh84vxX4LqrY4qK X-Received: by 2002:a5d:96cb:: with SMTP id r11mr25505616iol.53.1626852180386; Wed, 21 Jul 2021 00:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626852180; cv=none; d=google.com; s=arc-20160816; b=XXS5PDVn0KW00djRRnhcy+aC+/02QVs9U2NBpVtMrk2x65PmYz301f4G5vidTHljt8 BiW3qSmHo2PXuJUk5T+uheD9rrk6ICIZePKOGnk89A04zHnfTbdY9Cbmy2v46xKwlERc Gz/yF1rZ70da9LB/bT0vuGGRPUNVLQL+IJsLEy5XufctpNjWT8CJjknzkgA0ApybgErR 2r9PF1RVMGzFJFFchWO0Pe4YHhFE2uChRidmz5djZ2hkK/6+ZVZVV3QwFoU61kiYvTz0 JjNvRCqS8G7y3trENfA+ulDAvj/oybRkbGS9qYV5g4mCusuTzn0r5WtnP2N8BXTs80c/ e8/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=Kgy4H0YnLX5ScoL3QyyeQzDjHUhMEE1qEdNAjgktKng=; b=sS12p0k0KFpGcjfWILBpafbv/gW/wBzrJbKNSLZgV6shZ1JeiWJ5hCNBMfwx6RacEv qGsiuvz4GjhniCO6rABaS4X4G+JsYPqEO3AAczCRr2+hsjoESIii+UnHRe/liOSIiaFB KJV+0vaQrk3WarSLfPPGGtFOztKBH3CwD2bk0sHxpGUbr7QSFjA/YZWs0yesnqWo8MC1 J6PV9Ii6dlpk03kNzQjxVjtTkk8AcUBXcDPNHJMvmA3mWjYW7eyz1FQAcn+1ElAlnTRf RFozTc4JJQfNQGZKP+4E/Vd+ZOxm6yu/oRtdGIYZztG9PrOOoF/aBkaVZccX6czZlbVM Z4+g== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si26895435ile.135.2021.07.21.00.22.47; Wed, 21 Jul 2021 00:23:00 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235061AbhGUGgo (ORCPT + 99 others); Wed, 21 Jul 2021 02:36:44 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:57103 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233002AbhGUGag (ORCPT ); Wed, 21 Jul 2021 02:30:36 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=haoxu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UgV-rZj_1626851460; Received: from B-25KNML85-0107.local(mailfrom:haoxu@linux.alibaba.com fp:SMTPD_---0UgV-rZj_1626851460) by smtp.aliyun-inc.com(127.0.0.1); Wed, 21 Jul 2021 15:11:00 +0800 Subject: Re: [RFC 0/4] open/accept directly into io_uring fixed file table To: Pavel Begunkov , Jens Axboe , io-uring@vger.kernel.org Cc: "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: From: Hao Xu Message-ID: <39d65414-d3af-5af5-e8e8-fc883731700e@linux.alibaba.com> Date: Wed, 21 Jul 2021 15:11:00 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/7/7 下午7:39, Pavel Begunkov 写道: > Implement an old idea allowing open/accept io_uring requests to register > a newly created file as a io_uring's fixed file instead of placing it > into a task's file table. The switching is encoded in io_uring's SQEs > by setting sqe->buf_index/file_index, so restricted to 2^16-1. Don't > think we need more, but may be a good idea to scrap u32 somewhere > instead. > > From the net side only needs a function doing __sys_accept4_file() > but not installing fd, see 2/4. > > Only RFC for now, the new functionality is tested only for open yet. > I hope we can remember the author of the idea to add attribution. > Great feature! I believe this one leverages linked sqes, we may need to remind users to be careful when they use this feature in shared sqthread mode since linked sqes may be splited. > Pavel Begunkov (4): > io_uring: allow open directly into fixed fd table > net: add an accept helper not installing fd > io_uring: hand code io_accept()' fd installing > io_uring: accept directly into fixed file table > > fs/io_uring.c | 113 +++++++++++++++++++++++++++++----- > include/linux/socket.h | 3 + > include/uapi/linux/io_uring.h | 2 + > net/socket.c | 71 +++++++++++---------- > 4 files changed, 138 insertions(+), 51 deletions(-) >