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 BDB65ECAAA1 for ; Tue, 30 Aug 2022 12:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiH3Muh (ORCPT ); Tue, 30 Aug 2022 08:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbiH3Mug (ORCPT ); Tue, 30 Aug 2022 08:50:36 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A26B2A3D39 for ; Tue, 30 Aug 2022 05:50:35 -0700 (PDT) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27U7a7Mi009001 for ; Tue, 30 Aug 2022 05:50:34 -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=G2A4kzMWmMHwVR1gIxGsEfytt8rlUmw0cK1988HKQqU=; b=mLrjKsjENqHo6PG9QVEXeJfUy6T8C3APDVyvBscOBYybcs5PDgLfhdM8YEt0PkJiWNFe 9a61QhBf85H/h4H9VPOlqUX6CjZvydVR9jHx6vNcFVUPyqHli5nfcWd2gg08hAWi4hDR X2f6wOA8GlU56+h3Fe8zm8Ba6eIcEbPhin4= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3j9e9ysbg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 30 Aug 2022 05:50:34 -0700 Received: from twshared8288.05.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; Tue, 30 Aug 2022 05:50:33 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id EA5C655BF50E; Tue, 30 Aug 2022 05:50:30 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov , CC: , Dylan Yudaken Subject: [PATCH for-next v4 3/7] io_uring: do not run task work at the start of io_uring_enter Date: Tue, 30 Aug 2022 05:50:09 -0700 Message-ID: <20220830125013.570060-4-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220830125013.570060-1-dylany@fb.com> References: <20220830125013.570060-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: 794CRfYyXisXU6acie3XT3OWcnqCeKPl X-Proofpoint-GUID: 794CRfYyXisXU6acie3XT3OWcnqCeKPl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-30_07,2022-08-30_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org This is not needed, and it is normally better to wait for task work until after submissions. This will allow greater batching if either work arrive= s in the meanwhile, or if the submissions cause task work to be queued up. For SQPOLL this also no longer runs task work, but this is handled inside the SQPOLL loop anyway. For IOPOLL io_iopoll_check will run task work anyway And otherwise io_cqring_wait will run task work Suggested-by: Pavel Begunkov Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 7998dc23360f..329d5b9d448e 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2991,8 +2991,6 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u= 32, to_submit, struct fd f; long ret; =20 - io_run_task_work(); - if (unlikely(flags & ~(IORING_ENTER_GETEVENTS | IORING_ENTER_SQ_WAKEUP = | IORING_ENTER_SQ_WAIT | IORING_ENTER_EXT_ARG | IORING_ENTER_REGISTERED_RING))) --=20 2.30.2