From patchwork Fri Dec 2 17:47:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13063077 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 8EF84C4321E for ; Fri, 2 Dec 2022 17:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234133AbiLBRsz (ORCPT ); Fri, 2 Dec 2022 12:48:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233845AbiLBRsu (ORCPT ); Fri, 2 Dec 2022 12:48:50 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0690DDEA52 for ; Fri, 2 Dec 2022 09:48:48 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id bx10so8979026wrb.0 for ; Fri, 02 Dec 2022 09:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kvcrquw/9FE/9ZLzt/8g/wNbT1LMb7RcF1Pe1u97K48=; b=Ki3Us8hfMsI+Jh8WW3Wo6nHe8mnJ5JQW4bYPSdyyLNjlhYOy9id+JjpBZSw0jKoNTB m0AIxgbvR8FEVryFXHvCRcrjBJsImIZYrU0lPLrRFRgH4Frj5E7O9sD/QnODtTvMxJWe uLb5n+PF07dJY0BI5MpVEIGGptDZbCsAqTw0/Cw6oe9Ccf/rZaoXbXmrL5lVjGIPLjPq j0Eejq9yP91emqadUbpioYXWRvCwDgBAQRS08MYCWU6as7+ABM7pnPlMSAH6EAJ/DJBr G5MoyE7NNBH3AcCmsSX3U9GPP4+KNHWMXt/Rfcpz368CJhIKJ9E5Mt48CLWmpGepis9C jlgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kvcrquw/9FE/9ZLzt/8g/wNbT1LMb7RcF1Pe1u97K48=; b=Cu72ti8Emlq+GMt0W+eNpCo/RwX3XBCQMWdT76xP0eX+hELJgusYawBjDL/JcQaFgS lFe52o2zHvM0cPEAI5w8l3qa0dB2JYdy05vZnfXm8KEjl7ZnAgIsk8SGacCAhgiGw7k3 VoleNLvxRixXQEdc8r51RaupJjBkOGWIG0CPBhKRdTdPwHbo7A0yF0sd1ZKnh4xveNE8 JoEakEYF5Zl/Rh3NlM7MbVYvkQii0XrZd3iSxYiNZR5pkLT7lAOxIWtZcgd8K2ndrt0u OpeBNd+ngzATd2EBMHCmTdZYQ/DZ7C3lT3VWjO6eLLcusfjUz697ZVk7vPesgE9Rf45t zdxg== X-Gm-Message-State: ANoB5pnrhin57FTIevaxelpUnmiBXpagtxYv0dKZXrj9y8WDjnmV8AP4 2XpWxFBZ5pisKd75NY4WcIiqxP+q9/4= X-Google-Smtp-Source: AA0mqf7rtIBg7OrX3c2nG3hxxIZtX66XNKotrz1eQKfhjibmS1HIXLq855jVjuaPZwcxn7sz76zkrQ== X-Received: by 2002:adf:f9c7:0:b0:242:4d2e:4547 with SMTP id w7-20020adff9c7000000b002424d2e4547mr572126wrr.535.1670003326285; Fri, 02 Dec 2022 09:48:46 -0800 (PST) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:a57e]) by smtp.gmail.com with ESMTPSA id i1-20020adfaac1000000b002238ea5750csm9368585wrc.72.2022.12.02.09.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:48:45 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 1/4] io_uring: protect cq_timeouts with timeout_lock Date: Fri, 2 Dec 2022 17:47:22 +0000 Message-Id: <9c79544dd6cf5c4018cb1bab99cf481a93ea46ef.1670002973.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Read cq_timeouts in io_flush_timeouts() only after taking the timeout_lock, as it's protected by it. There are many places where we also grab ->completion_lock, but for instance io_timeout_fn() doesn't and still modifies cq_timeouts. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov --- io_uring/timeout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 5b4bc93fd6e0..4c6a5666541c 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -72,10 +72,12 @@ static bool io_kill_timeout(struct io_kiocb *req, int status) __cold void io_flush_timeouts(struct io_ring_ctx *ctx) __must_hold(&ctx->completion_lock) { - u32 seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts); + u32 seq; struct io_timeout *timeout, *tmp; spin_lock_irq(&ctx->timeout_lock); + seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts); + list_for_each_entry_safe(timeout, tmp, &ctx->timeout_list, list) { struct io_kiocb *req = cmd_to_io_kiocb(timeout); u32 events_needed, events_got; From patchwork Fri Dec 2 17:47:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13063075 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 85C12C4321E for ; Fri, 2 Dec 2022 17:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234247AbiLBRsw (ORCPT ); Fri, 2 Dec 2022 12:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233936AbiLBRsu (ORCPT ); Fri, 2 Dec 2022 12:48:50 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929AEDEA75 for ; Fri, 2 Dec 2022 09:48:48 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id h7so2884728wrs.6 for ; Fri, 02 Dec 2022 09:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GrYhN8At7lRA3r7v6jfxG38dJqlpWb4W/HB7a0y1RSs=; b=GOMnd5uLyMQL2zojRoic+jluaoUSKOUJgnmXJ+k80Gx1MZnLgcOVBbjXf2cuhG59Qm caJP8cTijlU+TWEqDm38aBSqpXZ95IwVfts2W0XblHXc/RzkMkWbNgxqch7AP8EIDtIy unKnzRkMp/3RFMb9CejE2iQroXRRuK2T2C1pgDpK1TzqGbqq973KqkVkyDaCL2mLpmi3 /nYGluNk1XAco1ZCo+JRy8kPNr7ckFnSYuMV/TQnxUx3N/QaS9IqvYqRx0OddWHO6cv4 ofqk/DpFxPV4VC9osdnR5w8saiHDdqpbR8jjy889nwSBt2Uld6t76P+Ye5NV9vYd+KTW PVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GrYhN8At7lRA3r7v6jfxG38dJqlpWb4W/HB7a0y1RSs=; b=IoDL5nkOK58Dm/tW9QdorjmfLEilEJlvHbGyyytTYUtkKUILkQdyDlWmluWUJrfjfD arTP2WiinI0Lbd4Ff7DVIXk8X4iqG9BkBjX4IyNfkgfonMlXYj4JCV34ei1S7iEro02H GX+1m/JZvlAHpjrguWdJ0lXVjZayk8YWCfAA9s0mvrlZj16ZmTeJQIgX6PzjbwF+8sca uL+n/ROPsBXARFyHLXebZRaSJJuna8Nqf/NmGFd/mysq0T7xqqO17GRlFULS3COadLs9 0+ZN4w28juHr4IB08IcouzAxziCRoM9ZHaHImI950yamc/DxaOi8PmLYpY0+f2MK5lIM Stbg== X-Gm-Message-State: ANoB5pmDyi2YyFeh3IbMin9Hqu/AEOSs5tDjZfzEJvln5Kw9V18mdulm YwH7XtI/wnkm9rBSVZvfaQ7qqXI39X8= X-Google-Smtp-Source: AA0mqf6Lg64KwWimsJ7COwwYGJ/CfwicAg6Kml8958js3kHgKW44pwIEo4C1MoDBTosq7NBUMCSpqA== X-Received: by 2002:a5d:526b:0:b0:242:380:c10e with SMTP id l11-20020a5d526b000000b002420380c10emr24116556wrc.132.1670003326945; Fri, 02 Dec 2022 09:48:46 -0800 (PST) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:a57e]) by smtp.gmail.com with ESMTPSA id i1-20020adfaac1000000b002238ea5750csm9368585wrc.72.2022.12.02.09.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:48:46 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 2/4] io_uring: revise completion_lock locking Date: Fri, 2 Dec 2022 17:47:23 +0000 Message-Id: <88e75d481a65dc295cb59722bb1cf76402d1c06b.1670002973.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org io_kill_timeouts() doesn't post any events but queues everything to task_work. Locking there is needed for protecting linked requests traversing, we should grab completion_lock directly instead of using io_cq_[un]lock helpers. Same goes for __io_req_find_next_prep(). Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 16 ++++++++++++++-- io_uring/io_uring.h | 11 ----------- io_uring/timeout.c | 8 ++++++-- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index c30765579a8e..57c1c0da7648 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -582,6 +582,18 @@ void __io_commit_cqring_flush(struct io_ring_ctx *ctx) io_eventfd_flush_signal(ctx); } +static inline void io_cq_lock(struct io_ring_ctx *ctx) + __acquires(ctx->completion_lock) +{ + spin_lock(&ctx->completion_lock); +} + +static inline void io_cq_unlock(struct io_ring_ctx *ctx) + __releases(ctx->completion_lock) +{ + spin_unlock(&ctx->completion_lock); +} + /* keep it inlined for io_submit_flush_completions() */ static inline void io_cq_unlock_post_inline(struct io_ring_ctx *ctx) __releases(ctx->completion_lock) @@ -1038,9 +1050,9 @@ static void __io_req_find_next_prep(struct io_kiocb *req) { struct io_ring_ctx *ctx = req->ctx; - io_cq_lock(ctx); + spin_lock(&ctx->completion_lock); io_disarm_next(req); - io_cq_unlock_post(ctx); + spin_unlock(&ctx->completion_lock); } static inline struct io_kiocb *io_req_find_next(struct io_kiocb *req) diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 2277c05f52a6..ff84c0cfa2f2 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -87,17 +87,6 @@ static inline void io_req_task_work_add(struct io_kiocb *req) #define io_for_each_link(pos, head) \ for (pos = (head); pos; pos = pos->link) -static inline void io_cq_lock(struct io_ring_ctx *ctx) - __acquires(ctx->completion_lock) -{ - spin_lock(&ctx->completion_lock); -} - -static inline void io_cq_unlock(struct io_ring_ctx *ctx) -{ - spin_unlock(&ctx->completion_lock); -} - void io_cq_unlock_post(struct io_ring_ctx *ctx); static inline struct io_uring_cqe *io_get_cqe_overflow(struct io_ring_ctx *ctx, diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 4c6a5666541c..eae005b2d1d2 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -624,7 +624,11 @@ __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk, struct io_timeout *timeout, *tmp; int canceled = 0; - io_cq_lock(ctx); + /* + * completion_lock is needed for io_match_task(). Take it before + * timeout_lockfirst to keep locking ordering. + */ + spin_lock(&ctx->completion_lock); spin_lock_irq(&ctx->timeout_lock); list_for_each_entry_safe(timeout, tmp, &ctx->timeout_list, list) { struct io_kiocb *req = cmd_to_io_kiocb(timeout); @@ -634,6 +638,6 @@ __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk, canceled++; } spin_unlock_irq(&ctx->timeout_lock); - io_cq_unlock_post(ctx); + spin_unlock(&ctx->completion_lock); return canceled != 0; } From patchwork Fri Dec 2 17:47:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13063076 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 228A7C4332F for ; Fri, 2 Dec 2022 17:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234042AbiLBRsy (ORCPT ); Fri, 2 Dec 2022 12:48:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234048AbiLBRsu (ORCPT ); Fri, 2 Dec 2022 12:48:50 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 429F8BFCCA for ; Fri, 2 Dec 2022 09:48:49 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id h7so2884780wrs.6 for ; Fri, 02 Dec 2022 09:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yoefvsER00SUtr3JL020XR4BJX3LqQFz/lbi4KivLe8=; b=SzaGjGHleBNLw7y1Tnj0t+I9Pj+zuWKyHdV2Eu+GcX8Loa8H5/CwfrPxO7Rg4u5sg1 yqu8qGK6UXKCQTQIJovkvPiJY0JYrTe3514GeGpbfW9pU+pllKDR/koKi3Z5xfQ5jcvJ hQ9z6CdZtO+Bxi0lPs2zs40XV4fe14m2O10W0t8qR7bC5Pgxw/f9rUeBXSiDpLYA1XRm vrOLQdwIKZOnWIQgQzpwdhNyEXdeaSnxCbIm+X+cOWl4B+Y3+a/azgSzoAh9/ooFtO+G ivstP3uLkwqIvv7GdhVXrLuwqNLNeMhZDam93yIk/SrB896AqfUWlr/u63wSdeECq61X i57Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yoefvsER00SUtr3JL020XR4BJX3LqQFz/lbi4KivLe8=; b=AXLBbOBlgjYQ16H0BLg7w39mxh4N3N/yNupi2gz/SXhFoAPWNuoxxhtO9q8cnrnZR6 nFppCferUszwuJXQKuv0InGZMol0GqFtAnWeg5FKEr/G4Wt17XFDEn3r868fLw2BokeS LxDjfASb4ljAOB8OZhuOCM1/FZB9CizFo35+lIpyTdBhanmjQRVniDB4d6q/xNdQjzGM uv0wRhrz/CjhUrLLhpWcv9ZZNiH0Y8cYaBkh3lXwNKwCiBtEHdnMXzdxvmtskTFJV3HS eh+NG7k0etU+ESwq7pxiZ+4QQdsoeqASV764s47eJ4lsGfKBcjJ5PFzZoLYzSzYKQhcc 619g== X-Gm-Message-State: ANoB5plNLYvIM5+7CvsvcQpErnauI4SzN51pqPiEX5PEDMt88UdxkrvS ye/3cMdi/pTCiSWgjbMf7qGaPGdvcm8= X-Google-Smtp-Source: AA0mqf6eaXCPNBUmLr7QpJFfvZEQxYT9RGTNxQpSgZYVq9heqjBnF67BxZjVyUxmKIm4OYyjQ1rSQA== X-Received: by 2002:a5d:6444:0:b0:241:f75a:d6aa with SMTP id d4-20020a5d6444000000b00241f75ad6aamr28677104wrw.672.1670003327651; Fri, 02 Dec 2022 09:48:47 -0800 (PST) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:a57e]) by smtp.gmail.com with ESMTPSA id i1-20020adfaac1000000b002238ea5750csm9368585wrc.72.2022.12.02.09.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:48:47 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 3/4] io_uring: ease timeout flush locking requirements Date: Fri, 2 Dec 2022 17:47:24 +0000 Message-Id: <1e3dc657975ac445b80e7bdc40050db783a5935a.1670002973.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org We don't need completion_lock for timeout flushing, don't take it. Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 9 ++++----- io_uring/timeout.c | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 57c1c0da7648..4593016c6e37 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -570,12 +570,11 @@ static void io_eventfd_flush_signal(struct io_ring_ctx *ctx) void __io_commit_cqring_flush(struct io_ring_ctx *ctx) { - if (ctx->off_timeout_used || ctx->drain_active) { + if (ctx->off_timeout_used) + io_flush_timeouts(ctx); + if (ctx->drain_active) { spin_lock(&ctx->completion_lock); - if (ctx->off_timeout_used) - io_flush_timeouts(ctx); - if (ctx->drain_active) - io_queue_deferred(ctx); + io_queue_deferred(ctx); spin_unlock(&ctx->completion_lock); } if (ctx->has_evfd) diff --git a/io_uring/timeout.c b/io_uring/timeout.c index eae005b2d1d2..826a51bca3e4 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -50,7 +50,6 @@ static inline void io_put_req(struct io_kiocb *req) } static bool io_kill_timeout(struct io_kiocb *req, int status) - __must_hold(&req->ctx->completion_lock) __must_hold(&req->ctx->timeout_lock) { struct io_timeout_data *io = req->async_data; @@ -70,7 +69,6 @@ static bool io_kill_timeout(struct io_kiocb *req, int status) } __cold void io_flush_timeouts(struct io_ring_ctx *ctx) - __must_hold(&ctx->completion_lock) { u32 seq; struct io_timeout *timeout, *tmp; From patchwork Fri Dec 2 17:47:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13063078 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 6DE9DC47088 for ; Fri, 2 Dec 2022 17:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233845AbiLBRs4 (ORCPT ); Fri, 2 Dec 2022 12:48:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234148AbiLBRsv (ORCPT ); Fri, 2 Dec 2022 12:48:51 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB32DEA66 for ; Fri, 2 Dec 2022 09:48:49 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso6996195wme.5 for ; Fri, 02 Dec 2022 09:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6EGxL9OtoW/M7niOGVS3YX0lKi57YksW9hdh1P9O0+M=; b=YPKaumVvbkJRR7qeFxniS9pF1zvORoUYaTYtTIN0ITzUH7hWSsI4OtuQ91F3oi5Qsq yUo0aIisfDqSfIqFWGlqJNCpxCh9PebtZk+4QG/lm0Q1aWD1+Iia5zGKBnN+rpdfVC8k TQmCbyQk9WI0gwrTKSzQZx2piGvN5WFsAhBsXPOPJFU5tvwp2DtzLlIOlyGxqGKJx2kw HqCPkDUtPUSV+/Zc1KqJAI+6rvdsgpIHOnkN4epJOZ3YvLeJi8eXSG0fpbws1oi8MCVH NKpbPwJcOtVfELuBIgtrID3zuEirV+r86pTPUi7EkRv3UVCdCQXTO0M5aJ6+NUlHuAny w3wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6EGxL9OtoW/M7niOGVS3YX0lKi57YksW9hdh1P9O0+M=; b=cwL6iT8FToKPMv4zljhrFIDhNVpm7ua4pjEwSkxlMfFF04bG+rLITxKIdxzFSZrDS4 WYegPH98yxgMYk/nCFL8MvgkQ388v+LF77zvvhaJc8PtL3d7WkqeKVKgX9hqFKsEdB/S KwuJUpAla138cKlj1wQaf24/nuQw5oBe5RS2mSjbNyzfsioVsaSfTql/ddycm09P9rxP GFEuBEyjiGge2kRXgQwyKKp3kfm/RrR1cjX27nqLcx6ohcZuA8m+mmGqYGLjZYiOHpGW /6iCWHT+Kv3bFYV4s/Klpm12ytE54ZmIzkiqarQUR4IOzxY4j/tlA86qEOhBdOha610V mU9w== X-Gm-Message-State: ANoB5plvNtydwXLb1wcpJy0bWZav0CAQGvvD88UEMhGgGXzoh/EuMbfH M8oSf6/PonPRBadMo4T4tzZKHb7rEg4= X-Google-Smtp-Source: AA0mqf6W8X+tnS8Phfo95rtONYn0+cxOw73SeePgBFokWoFTMmDW4xZp4FniUgDcyGSITGEQVFc21A== X-Received: by 2002:a05:600c:19d1:b0:3cf:ca1a:332a with SMTP id u17-20020a05600c19d100b003cfca1a332amr57222837wmq.118.1670003328342; Fri, 02 Dec 2022 09:48:48 -0800 (PST) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:a57e]) by smtp.gmail.com with ESMTPSA id i1-20020adfaac1000000b002238ea5750csm9368585wrc.72.2022.12.02.09.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:48:48 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 4/4] io_uring: rename __io_fill_cqe_req Date: Fri, 2 Dec 2022 17:47:25 +0000 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org There is no io_fill_cqe_req(), remove the previx from __io_fill_cqe_req(). Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 4 ++-- io_uring/io_uring.h | 2 +- io_uring/rw.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 4593016c6e37..436b1ac8f6d0 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -894,7 +894,7 @@ static void __io_req_complete_post(struct io_kiocb *req) io_cq_lock(ctx); if (!(req->flags & REQ_F_CQE_SKIP)) - __io_fill_cqe_req(ctx, req); + io_fill_cqe_req(ctx, req); /* * If we're the last reference to this request, add to our locked @@ -1405,7 +1405,7 @@ static void __io_submit_flush_completions(struct io_ring_ctx *ctx) comp_list); if (!(req->flags & REQ_F_CQE_SKIP)) - __io_fill_cqe_req(ctx, req); + io_fill_cqe_req(ctx, req); } io_cq_unlock_post_inline(ctx); diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index ff84c0cfa2f2..62227ec3260c 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -110,7 +110,7 @@ static inline struct io_uring_cqe *io_get_cqe(struct io_ring_ctx *ctx) return io_get_cqe_overflow(ctx, false); } -static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx, +static inline bool io_fill_cqe_req(struct io_ring_ctx *ctx, struct io_kiocb *req) { struct io_uring_cqe *cqe; diff --git a/io_uring/rw.c b/io_uring/rw.c index 1ce065709724..1ecce80508ee 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -1061,7 +1061,7 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin) continue; req->cqe.flags = io_put_kbuf(req, 0); - __io_fill_cqe_req(req->ctx, req); + io_fill_cqe_req(req->ctx, req); } if (unlikely(!nr_events))