From patchwork Wed Nov 23 11:06:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13053467 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 5BA5DC4332F for ; Wed, 23 Nov 2022 11:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237415AbiKWLHb (ORCPT ); Wed, 23 Nov 2022 06:07:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237680AbiKWLG6 (ORCPT ); Wed, 23 Nov 2022 06:06:58 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A802156EF3 for ; Wed, 23 Nov 2022 03:06:42 -0800 (PST) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ANB4PXp007756 for ; Wed, 23 Nov 2022 03:06:42 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=xrpdzGsOSo95/SQ7TUl7Ka4Y4KT5Qjp35Cxs0HYJzks=; b=frfT+yJOmmO3XGeBCnr0KAZgGqnXtFZl9h2WYsNW8QAJZ52G8p5WfbWsieDFVq0x5hYR oixAm/VjIM0yEyZVb9XHZeu5qVIW5XFw3mig4nnklsfO3UAadgoZQhtUHxyeeyKcCjr1 VH8uEOD4NDye+TWHKBnibfHeosoOeXBmvNblXebESlXjzTMtuNp1MLJrL4Fu2yWa7uUX 9S/w+Jf/EHtcZk3cLELTar6Sb+tivmakfu7xt9WxtWKyZ0Yt/8qYBPjMo9/YaucAPCuL A6dKkvy9Nakl9FNlFvsC9OJgeqeS+0f7ywo4pSqOjjrWUeuC5D/lar3ZIiu8myrC58lN uA== Received: from maileast.thefacebook.com ([163.114.130.8]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3m17esbjnq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 23 Nov 2022 03:06:42 -0800 Received: from twshared0705.02.ash8.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; Wed, 23 Nov 2022 03:06:40 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 81F2BA0804BA; Wed, 23 Nov 2022 03:06:26 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH for-next v2 02/13] io_uring: __io_req_complete should defer if available Date: Wed, 23 Nov 2022 03:06:03 -0800 Message-ID: <20221123110614.3297343-3-dylany@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221123110614.3297343-1-dylany@meta.com> References: <20221123110614.3297343-1-dylany@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: ChHLSGDhSq5mK2ou5QAxPDtQjnXG1B4X X-Proofpoint-ORIG-GUID: ChHLSGDhSq5mK2ou5QAxPDtQjnXG1B4X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-23_06,2022-11-23_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org For consistency always defer completion if specified in the issue flags. Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index e40d7b3404eb..0741a728fb6a 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -858,7 +858,10 @@ void io_req_complete_post(struct io_kiocb *req) inline void __io_req_complete(struct io_kiocb *req, unsigned issue_flags) { - io_req_complete_post(req); + if (issue_flags & IO_URING_F_COMPLETE_DEFER) + io_req_complete_defer(req); + else + io_req_complete_post(req); } void io_req_complete_failed(struct io_kiocb *req, s32 res)