From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3B8DC07E9D for ; Mon, 26 Sep 2022 17:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbiIZRmf (ORCPT ); Mon, 26 Sep 2022 13:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbiIZRmP (ORCPT ); Mon, 26 Sep 2022 13:42:15 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0813178BC for ; Mon, 26 Sep 2022 10:09:39 -0700 (PDT) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 28Q9CnoI018797 for ; Mon, 26 Sep 2022 10:09:39 -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=QjTyb5cqB8JpM+faMD/4F0TT8m42x/Q1YTWctvgR8EE=; b=K3MpZKDPFT+Sn8s4QizUGgYe7GZ9DToWTuRPkhEVZPt2THTp0xlX6kmqgk6R7EmqDRj9 dc21rqeaiJg6RVzD+WVZQUAndV/43+m05lt863/QGe3CB7fSeVRYApps70i/VO7LE5+L f62eWmOCLbx6Sdhb0vO95QiEBokXgE6McxM= Received: from maileast.thefacebook.com ([163.114.130.16]) by m0001303.ppops.net (PPS) with ESMTPS id 3jswjumsd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 26 Sep 2022 10:09:38 -0700 Received: from twshared2996.07.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::5) 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:38 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id D682A6B0A930; Mon, 26 Sep 2022 10:09:27 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , , Dylan Yudaken Subject: [PATCH v2 3/3] io_uring: remove io_register_submitter Date: Mon, 26 Sep 2022 10:09:27 -0700 Message-ID: <20220926170927.3309091-4-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220926170927.3309091-1-dylany@fb.com> References: <20220926170927.3309091-1-dylany@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: lMlNPfJHK3P9C5T7sWIFbQR9K2qiU0sU X-Proofpoint-ORIG-GUID: lMlNPfJHK3P9C5T7sWIFbQR9K2qiU0sU 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 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org this is no longer needed, as submitter_task is set at creation time. Signed-off-by: Dylan Yudaken --- io_uring/tctx.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/io_uring/tctx.c b/io_uring/tctx.c index dd0205fcdb13..4324b1cf1f6a 100644 --- a/io_uring/tctx.c +++ b/io_uring/tctx.c @@ -91,20 +91,6 @@ __cold int io_uring_alloc_task_context(struct task_str= uct *task, return 0; } =20 -static int io_register_submitter(struct io_ring_ctx *ctx) -{ - int ret =3D 0; - - mutex_lock(&ctx->uring_lock); - if (!ctx->submitter_task) - ctx->submitter_task =3D get_task_struct(current); - else if (ctx->submitter_task !=3D current) - ret =3D -EEXIST; - mutex_unlock(&ctx->uring_lock); - - return ret; -} - int __io_uring_add_tctx_node(struct io_ring_ctx *ctx) { struct io_uring_task *tctx =3D current->io_uring; @@ -151,11 +137,9 @@ int __io_uring_add_tctx_node_from_submit(struct io_r= ing_ctx *ctx) { int ret; =20 - if (ctx->flags & IORING_SETUP_SINGLE_ISSUER) { - ret =3D io_register_submitter(ctx); - if (ret) - return ret; - } + if (ctx->flags & IORING_SETUP_SINGLE_ISSUER + && ctx->submitter_task !=3D current) + return -EEXIST; =20 ret =3D __io_uring_add_tctx_node(ctx); if (ret) --=20 2.30.2