Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp216485rwb; Mon, 26 Sep 2022 11:18:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+rQt+c4acxY9bAisGmJTfBkbBRA5gnC7n8DHFyD/Cp5AsURgHuEm6LfQBh//xfjfppLd+ X-Received: by 2002:a05:6402:3591:b0:451:8397:3e9 with SMTP id y17-20020a056402359100b00451839703e9mr23474569edc.409.1664216317564; Mon, 26 Sep 2022 11:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664216317; cv=none; d=google.com; s=arc-20160816; b=BieE8ZEZ2J5bWIBHMmgNGB0+yUjZlcb1R9LIkm4XDoRNGajZzquL8hU4wbj/lHp5tR PK76AidXT2nWjqbrZ8RuF07y3mAkfUkQeVyT+3FTPjR5maKoq3w2B30XDOBHzGQmn3QG GeG7bMRfKw3EJA9BlGoaK4PBCT/MinB/EXr32hQbjL7XQOgqDLYnY0Ov7c7uSvehCeat LUnDUQGv5z/Sk9tppSiG9KZmqtXQFublUZDWz3tieGqhxnQbPuU5m/mL1VrZQ/bEMJmm zTa5y7ssq3KVJY2St+eNE4MLOyGWLGCMZKR+d45JYHJaMAZg4pQxGZg+WHr1+dHrpGN3 DPGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=54Bgf2xY0Zg2e6Dq0/RfM1UcHe9yEbbljzjT/X/EXqE=; b=ZPgxb9hhowSbwDNa9HFSsBNNJDrfdLzNGsu6ipFfuqk/kx3sHVlr9ty4ECWFR2+Cqa h6yozXAEhIyTB4eG0+2135Vd0FFxMzJCJ58NGw+wCqjdif9W6HXEIlz9DenhPPQRsoYr P4L/8e56CDYIRmBePyUCXwVVxl8pXV98y5XX4qkGzbG0dVquOW8yTSeB456/qxummUqs rS4bwkMahqBooCws45DNego4em7rH8ZgHTONk1XKOsA0TNTSdiPWbMHVBVNB60eHCkV9 mbYECmPVzsNaMjeW2aBSvI4UgAII4sTkehM6EXtD4HcCkZ40U6OVJn76vi0S+c7ibqtb 8sZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=ffEf+dls; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lu24-20020a170906fad800b007316ac034a1si427449ejb.831.2022.09.26.11.18.10; Mon, 26 Sep 2022 11:18:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=ffEf+dls; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbiIZRmc (ORCPT + 99 others); Mon, 26 Sep 2022 13:42:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbiIZRmM (ORCPT ); Mon, 26 Sep 2022 13:42:12 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB2D1DEE6 for ; Mon, 26 Sep 2022 10:09:33 -0700 (PDT) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28QGPTsj010762 for ; Mon, 26 Sep 2022 10:09:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=54Bgf2xY0Zg2e6Dq0/RfM1UcHe9yEbbljzjT/X/EXqE=; b=ffEf+dls6jlmcb3R2A+40lg0PP9TDCnRU7VdSHx8PQ0JZEwc+DOuJqPUfPeVssrZDpwP X1mThMw1FQd+WjPTLJWFE2ugT/IRgKVfbsqtnT91DUEYvJhZ3cCF5HMeczGfatcfosT7 CoOuxokP0Sn0V67k6SF0l3pRSue5hMhQszU= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3jsydxved0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 26 Sep 2022 10:09:32 -0700 Received: from snc-exhub201.TheFacebook.com (2620:10d:c085:21d::7) by snc-exhub102.TheFacebook.com (2620:10d:c085:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 26 Sep 2022 10:09:31 -0700 Received: from twshared3888.09.ash9.facebook.com (2620:10d:c085:108::4) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 26 Sep 2022 10:09:30 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id C41B76B0A929; Mon, 26 Sep 2022 10:09:27 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , , Dylan Yudaken Subject: [PATCH v2 0/3] io_uring: register single issuer task at creation Date: Mon, 26 Sep 2022 10:09:24 -0700 Message-ID: <20220926170927.3309091-1-dylany@fb.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: 128FE4zZxkchUDrdjpZBCKPGumCtXvSy X-Proofpoint-GUID: 128FE4zZxkchUDrdjpZBCKPGumCtXvSy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-26_09,2022-09-22_02,2022-06-22_01 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Registering the single issuer task from the first submit adds unnecesary complications to the API as well as the implementation. Where simply registering it at creation should not impose any barriers to getting the same performance wins. The only catch is users that might want to move th= e ring after creation but before submission. For these users allow them to create the ring with IORING_SETUP_R_DISABLED and then enable it on the submission task. There is another problem in 6.1, with IORING_SETUP_DEFER_TASKRUN. That would like to check the submitter_task from unlocked contexts, which woul= d be racy. If upfront the submitter_task is set at creation time it will simplify the logic there and probably increase performance (though this i= s unmeasured). Patch 1 registers the task at creation of the io_uring, this works standalone in case you want to only merge this part for 6.0 Patch 2/3 cleans up the code from the old style v2: - add the IORING_SETUP_R_DISABLED logic Dylan Yudaken (3): io_uring: register single issuer task at creation io_uring: simplify __io_uring_add_tctx_node io_uring: remove io_register_submitter io_uring/io_uring.c | 9 ++++++++- io_uring/tctx.c | 42 ++++++++++++++++++------------------------ io_uring/tctx.h | 6 ++++-- 3 files changed, 30 insertions(+), 27 deletions(-) base-commit: f76349cf41451c5c42a99f18a9163377e4b364ff --=20 2.30.2