From patchwork Fri Nov 25 10:34:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13055742 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 B6D60C4332F for ; Fri, 25 Nov 2022 10:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbiKYKee (ORCPT ); Fri, 25 Nov 2022 05:34:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiKYKed (ORCPT ); Fri, 25 Nov 2022 05:34:33 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D12931238 for ; Fri, 25 Nov 2022 02:34:32 -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 2AP4oTSV016731 for ; Fri, 25 Nov 2022 02:34:31 -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=P7yTMIOnFcIis1FwEoARvVLBdtf6/yttrHIQzWbzZHE=; b=OvemSbvbcwCe4mRZVvTHjqrVMDi90FJ9LBWdJCcnGN9b0IUc8KHX+Q9nz00VrilRp6Fo C9uOf5PDWhhm3TxxSncOwodNGDpnVMgNLQpt5XPWw6voL+Bmb1wiwi9pd0IPgD3kFnuu mCQ0AczDGc30W2eE9jMY8jnaj6Yv2lFVq3axddoksT4G+22axZKUwA99TfeJjGIlX4J0 Y7XYjtb5Q+qCWmuhxOVzmOy8paxltaZGtNtnNNmHFbrR71mUeWN93aYt/swOd7q30nDZ jzFzwvjxf0G016Srma8ZlTJlSDkwgu1EGqDvUae4Yar9lQ14U5HEO3jBq+JCMYo5z03s Uw== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3m1w891x05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 25 Nov 2022 02:34:31 -0800 Received: from twshared8047.05.ash9.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:21d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 02:34:30 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id E5461A283EC8; Fri, 25 Nov 2022 02:34:20 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH for-next 1/3] io_uring: remove io_req_complete_post_tw Date: Fri, 25 Nov 2022 02:34:10 -0800 Message-ID: <20221125103412.1425305-2-dylany@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221125103412.1425305-1-dylany@meta.com> References: <20221125103412.1425305-1-dylany@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: okJ3g0DNibugIMVvzprJLgQKHgSPXLq3 X-Proofpoint-GUID: okJ3g0DNibugIMVvzprJLgQKHgSPXLq3 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-25_02,2022-11-25_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org It's only used in one place. Inline it. Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 2 +- io_uring/io_uring.h | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 164904e7da25..38589cf380d1 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1521,7 +1521,7 @@ void io_req_task_complete(struct io_kiocb *req, bool *locked) if (*locked) io_req_complete_defer(req); else - io_req_complete_post_tw(req, locked); + io_req_complete_post(req, IO_URING_F_UNLOCKED); } /* diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index dcb8e3468f1d..76659d2fc90c 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -37,13 +37,6 @@ bool io_aux_cqe(struct io_ring_ctx *ctx, bool defer, u64 user_data, s32 res, u32 bool allow_overflow); void __io_commit_cqring_flush(struct io_ring_ctx *ctx); -static inline void io_req_complete_post_tw(struct io_kiocb *req, bool *locked) -{ - unsigned flags = *locked ? 0 : IO_URING_F_UNLOCKED; - - io_req_complete_post(req, flags); -} - struct page **io_pin_pages(unsigned long ubuf, unsigned long len, int *npages); struct file *io_file_get_normal(struct io_kiocb *req, int fd); From patchwork Fri Nov 25 10:34:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13055743 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 50C79C4321E for ; Fri, 25 Nov 2022 10:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbiKYKee (ORCPT ); Fri, 25 Nov 2022 05:34:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiKYKed (ORCPT ); Fri, 25 Nov 2022 05:34:33 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D19331369 for ; Fri, 25 Nov 2022 02:34:32 -0800 (PST) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2APA8pL7027508 for ; Fri, 25 Nov 2022 02:34:32 -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=zRnNbzQplCPqbQ8YDFhZkzknA3sqTPe8tykIwMwY438=; b=EpLs3eODaHvYn8+hIfOjWs1OAEmNlRnNnSnKnqdZLVNQiwZZT8yfPKM0xnqz6dUZVRMF Gsso7QMykWwex9yGdp1i8eCicNeKopX2HdQl7mo8KU6HvlkDqv+xk9/G5/cmlln3J4PE J/PSTPMCFrTUWRT0BGfMYasyTqsgNURDjDfTiI3BLV/nx9tv9KBM527mxP2PP3foyd9Z nTGRUlVEUdDG5IqVgX43XyvQyofU/R7aeLzYUqC14xsuTc+B5AQfsHFf2l0/O1wGflO/ JqKs8bFiEly1MNbaYm59618VmEAPiRZ1hf5wl52PQXYMK+A9NGt4PDSSjuvvHk0RtiQu fw== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3m2upf84eu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 25 Nov 2022 02:34:31 -0800 Received: from twshared8047.05.ash9.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 02:34:30 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id E71C8A283EC9; Fri, 25 Nov 2022 02:34:20 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH for-next 2/3] io_uring: spelling fix Date: Fri, 25 Nov 2022 02:34:11 -0800 Message-ID: <20221125103412.1425305-3-dylany@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221125103412.1425305-1-dylany@meta.com> References: <20221125103412.1425305-1-dylany@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: e0-qjlRvi7nPKJD7QLy7F4YvxOvZAZrO X-Proofpoint-ORIG-GUID: e0-qjlRvi7nPKJD7QLy7F4YvxOvZAZrO 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-25_02,2022-11-25_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org s/pushs/pushes/ Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 38589cf380d1..c1e84ef84bea 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2708,7 +2708,7 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait) * lock(&ep->mtx); * * Users may get EPOLLIN meanwhile seeing nothing in cqring, this - * pushs them to do the flush. + * pushes them to do the flush. */ if (io_cqring_events(ctx) || io_has_work(ctx)) From patchwork Fri Nov 25 10:34:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13055744 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 AF309C4167D for ; Fri, 25 Nov 2022 10:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229617AbiKYKeg (ORCPT ); Fri, 25 Nov 2022 05:34:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiKYKee (ORCPT ); Fri, 25 Nov 2022 05:34:34 -0500 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E82B42F5C for ; Fri, 25 Nov 2022 02:34:33 -0800 (PST) Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AP1torj023634 for ; Fri, 25 Nov 2022 02:34:32 -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=DuCAbePoNtVA9YhQGc2rxpjQN3n4AJ+7V0URsBoLK5c=; b=lVZRZFcGVHSbu+NBiIKdfGIAu/GqHiLBqHcmgMQm0MXW8Ape7DVbqrKUEFxPK4GHbDWz Ru05ILj4PXs3ZdQjjvsy/5hYWkya7PY8EDNtegqWhdNgNB8K4cnoDpjoAy+bTKWmMrk6 Om7VvNcvjB/IPnE6ZvxKTFSeAO2EARMuODA7ssFxV8H4nfsDHY6PiuV4OyC7/3pOcNcY HklgYXf65HEiqg6xvBQZO0YSNOlxYUkbpAKNkYHxY5XiW2dUaivmqg1jJMJFrKQ2rOOo 5h+H7Fv56HcHSbzSOXXInZcNNx3X/nw06Jr8ffqWJMysE6rzn65a7dNZmmsl/UDCLgDz eg== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3m2b2hnq4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 25 Nov 2022 02:34:32 -0800 Received: from twshared8047.05.ash9.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:21d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 02:34:31 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 41AACA283ECB; Fri, 25 Nov 2022 02:34:20 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH for-next 3/3] io_uring: Revert "io_uring: io_req_complete_post should defer if available" Date: Fri, 25 Nov 2022 02:34:12 -0800 Message-ID: <20221125103412.1425305-4-dylany@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221125103412.1425305-1-dylany@meta.com> References: <20221125103412.1425305-1-dylany@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: aDxxcv5B4od95rEL0Rb7Z0nOyfvYaf_V X-Proofpoint-GUID: aDxxcv5B4od95rEL0Rb7Z0nOyfvYaf_V 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-25_02,2022-11-25_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org This is not needed, as everywhere that calls io_req_complete_post already knows it will not be deferring. This reverts commit 8fa737e0de7d3c4dc3d7cb9a9d9a6362d872c3f3. Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index c1e84ef84bea..d9c9e347346d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -908,9 +908,7 @@ static void __io_req_complete_post(struct io_kiocb *req) void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags) { - if (issue_flags & IO_URING_F_COMPLETE_DEFER) { - io_req_complete_defer(req); - } else if (!(issue_flags & IO_URING_F_UNLOCKED) || + if (!(issue_flags & IO_URING_F_UNLOCKED) || !(req->ctx->flags & IORING_SETUP_IOPOLL)) { __io_req_complete_post(req); } else {