Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp22528rwb; Mon, 26 Sep 2022 08:49:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ei4YOSQ5Z69RlLTYjjahLFueK1k4q42Oo0UnXc46/5ZQ5EXZLPajgIc5lMlNYIveHv/Zt X-Received: by 2002:a17:90b:4d0e:b0:1f7:ae99:4d7f with SMTP id mw14-20020a17090b4d0e00b001f7ae994d7fmr36418207pjb.200.1664207346020; Mon, 26 Sep 2022 08:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664207346; cv=none; d=google.com; s=arc-20160816; b=tjzFwAyd/d+1LpdpplrwviD72zmzIezKCcK6BnVpo6HH6bWAcsCAztYe4oskTo53c2 fmzfkF6voUC1odxa1KTUU4S7wGEQrF+tDQC+8k7kxjQWMii1KsS35t0c89p6nd5IU3sz XU4rUfxO8lZTckkmSlwpaW8pQ3ztR0rDG1MBm8Dci/4zN7NMIWm2x7mXBnq6irKEHIHp DDmMwJAJkMYpJSLq9GDMHIV9nw+9EfEJVCw1SVxruRilNsjJkSB/hVrTMRtYMnWGBtjp 9K8l+6I/se9g1N+8jD4gKcKWijCf/VjG1bYkM3tWe7mKZdWXHm6bTX353tfR8lgU3gSz io1g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k8e9XhReGPOptOw1DYeKjrBV9CjaPrV9yHOCxxhlJFU=; b=vkhY03lI+q/qKKCVASBW7MKrwkS8TKsMFWFLhFGMC3rFMy1LQHIiavU4h5RvwW9F0S cgdyfqjl+Jx1cs8diWRKbbwuZS/DZAbiaQShVdaLTk01qp4Tqg4wcRPtG0dojC0IvdWn N8BOmf2aSj9Ao3Yus4N2pS+RChVcbn3z0vT/2eGrFUd8SnMoBgjOWII+DCMxP5v+8oEU f6G0E4LWSJYrgMGLWms4faHKBQw+N9Ffb0cB6wHmGAwR+vnDwAFVnTsOO6lLkYdTPrTh lqJUSjA03CUNY/l3gSZlj5mo8XILdNvqU2gt2L2zpKqk5S7Gg5WVKz3i3JtRYcZxWOPk jTtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lppCbCxF; 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 m2-20020a63ed42000000b0042b80821b1csi18080387pgk.371.2022.09.26.08.48.53; Mon, 26 Sep 2022 08:49:06 -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=lppCbCxF; 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 S236101AbiIZPRm (ORCPT + 99 others); Mon, 26 Sep 2022 11:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236053AbiIZPQt (ORCPT ); Mon, 26 Sep 2022 11:16:49 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F50B55BD for ; Mon, 26 Sep 2022 07:03:26 -0700 (PDT) Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28Q90n3u022669 for ; Mon, 26 Sep 2022 07:03:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=k8e9XhReGPOptOw1DYeKjrBV9CjaPrV9yHOCxxhlJFU=; b=lppCbCxFHVAzTHD+1WMAbeJS6i673QDtY5cBg4uEkuamPn+oy8k1FiyHHKfb38NmwmYU OOUITycrHWoqRVSxUOWqh8+I1CXUmhno49cHUpAs3vAPRwr4PDZb/Zi3Qiiuu1lMBsoi zenam7B5yS2RQyFZ1FnlwJCX79g5nanUrzc= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3jswxjucug-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 26 Sep 2022 07:03:26 -0700 Received: from twshared2996.07.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) 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 07:03:23 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 7E8636AEBEF6; Mon, 26 Sep 2022 07:03:17 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , , Dylan Yudaken Subject: [PATCH 1/3] io_uring: register single issuer task at creation Date: Mon, 26 Sep 2022 07:03:02 -0700 Message-ID: <20220926140304.1973990-2-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220926140304.1973990-1-dylany@fb.com> References: <20220926140304.1973990-1-dylany@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: WjrnFsqjGSbldC1MXCzD9H1aPW_OKXcj X-Proofpoint-GUID: WjrnFsqjGSbldC1MXCzD9H1aPW_OKXcj 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_08,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=unavailable 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 Instead of picking the task from the first submitter task, rather use the creator task. The downside of this is that users are unable to move tasks before submitting. However this simplifies the logic here. For example CQEs are able to be posted by io_uring_register, which could also be from a separate task. This could be confusing as this does not count as a submit, and so would not be the registered task. Additionally this removes init logic from the submission path, which can always be a bit confusing. Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 2965b354efc8..3f40defd721d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3357,6 +3357,9 @@ static __cold int io_uring_create(unsigned entries,= struct io_uring_params *p, goto err; } =20 + if (ctx->flags & IORING_SETUP_SINGLE_ISSUER) + ctx->submitter_task =3D get_task_struct(current); + file =3D io_uring_get_file(ctx); if (IS_ERR(file)) { ret =3D PTR_ERR(file); --=20 2.30.2