From patchwork Fri Jan 20 16:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13110208 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 A8BADC27C7C for ; Fri, 20 Jan 2023 16:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbjATQjG (ORCPT ); Fri, 20 Jan 2023 11:39:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjATQjG (ORCPT ); Fri, 20 Jan 2023 11:39:06 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1CEB6580 for ; Fri, 20 Jan 2023 08:39:02 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id az20so15417340ejc.1 for ; Fri, 20 Jan 2023 08:39:02 -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=kNXtuGs/ChtdEeAKTWqgirpCrA/uohpZGq3JkDE5JVo=; b=QwaOFeHQRLJYVwVgP2Q4/ZaFlTczZHXPK40kI2LmnWox2UuFIoc/PX+sXWh6PA6sIL TLiTPVWo6VBwW2oi9dmo2zIlZb25fg7iD4ZeiN2+H9hV6De+WJ/Lh1a58GWNUQqfm+cW 2OKosn74L+tiMJjROUmSctWENKeGRFNzq2T7OHPARvoAKZ3iQmjLcB/d77/3QWbBDE3M cRNKmX6uBFjaqQwUD6mAvuVtnOjsmUcY9SLMTBilBia/vTRJmqY+DvLBZ6+jtams6bbj 8Bf4QGhyF8GKS/kIZIe3xA9KutEW7KxmcfHfMaJLSHYAwSDlkqa9UdJyql7yvPQcszwO 7h0A== 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=kNXtuGs/ChtdEeAKTWqgirpCrA/uohpZGq3JkDE5JVo=; b=sTOiqwtdZI/MpMH07udsm6O1MHBwMx+pPLDv5feYw7NN++jQDxqvr6DM4Vhd3yMpSB BiGYD7STpuB5KmqxbH7HBoTx77PUXeLxNuSF3TYxmAAv1XMSOgbn+fnLcESbC7JpRKTn mAmoX5zJbCiupxUweIk6jUtQcm+xfqTuvLNoPZafOP5snZ1UkaaP3anClHFkaxu+igx/ xduXY1kEQAPy0ltMbA7ghG0nIGqp4kMRDPYL5BfXO4pc1KuVKNAyQpPRRhLjU9VUfMZl JK2x/WE4PD4sZHDJrVOWvBT0JOMxIVTexC32TjnCk7NqKCITLyGrnJHboAOQ6rsDgXMw 3lxw== X-Gm-Message-State: AFqh2kpoJDEEkTz5RPnCdadmi26BH3yFQ68jIAe8IGcJxzOBfGnaIdBi 7SgwaefnejctvMMKko8ZlpthKgR/5MY= X-Google-Smtp-Source: AMrXdXsfipxzwCIgIxJEqEH8FYEbqzCX/Ekj1LVyuT7cykB1ICM1Vki7r2a1FxlV48shdvKU8Ezp4A== X-Received: by 2002:a17:906:6b8f:b0:877:74e6:67a4 with SMTP id l15-20020a1709066b8f00b0087774e667a4mr6320336ejr.47.1674232740645; Fri, 20 Jan 2023 08:39:00 -0800 (PST) Received: from 127.com ([2620:10d:c092:600::2:4670]) by smtp.gmail.com with ESMTPSA id t27-20020a170906179b00b008762e2b7004sm4702124eje.208.2023.01.20.08.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 08:39:00 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-6.2 v2 1/3] io_uring/msg_ring: fix flagging remote execution Date: Fri, 20 Jan 2023 16:38:05 +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 a couple of problems with queueing a tw in io_msg_ring_data() for remote execution. First, once we queue it the target ring can go away and so setting IORING_SQ_TASKRUN there is not safe. Secondly, the userspace might not expect IORING_SQ_TASKRUN. Extract a helper and uniformly use TWA_SIGNAL without TWA_SIGNAL_NO_IPI tricks for now, just as it was done in the original patch. Fixes: 6d043ee1164ca ("io_uring: do msg_ring in target task via tw") Signed-off-by: Pavel Begunkov --- io_uring/msg_ring.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c index a333781565d3..bb868447dcdf 100644 --- a/io_uring/msg_ring.c +++ b/io_uring/msg_ring.c @@ -58,6 +58,25 @@ void io_msg_ring_cleanup(struct io_kiocb *req) msg->src_file = NULL; } +static inline bool io_msg_need_remote(struct io_ring_ctx *target_ctx) +{ + if (!target_ctx->task_complete) + return false; + return current != target_ctx->submitter_task; +} + +static int io_msg_exec_remote(struct io_kiocb *req, task_work_func_t func) +{ + struct io_ring_ctx *ctx = req->file->private_data; + struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); + + init_task_work(&msg->tw, func); + if (task_work_add(ctx->submitter_task, &msg->tw, TWA_SIGNAL)) + return -EOWNERDEAD; + + return IOU_ISSUE_SKIP_COMPLETE; +} + static void io_msg_tw_complete(struct callback_head *head) { struct io_msg *msg = container_of(head, struct io_msg, tw); @@ -96,15 +115,8 @@ static int io_msg_ring_data(struct io_kiocb *req, unsigned int issue_flags) if (msg->src_fd || msg->dst_fd || msg->flags) return -EINVAL; - if (target_ctx->task_complete && current != target_ctx->submitter_task) { - init_task_work(&msg->tw, io_msg_tw_complete); - if (task_work_add(target_ctx->submitter_task, &msg->tw, - TWA_SIGNAL_NO_IPI)) - return -EOWNERDEAD; - - atomic_or(IORING_SQ_TASKRUN, &target_ctx->rings->sq_flags); - return IOU_ISSUE_SKIP_COMPLETE; - } + if (io_msg_need_remote(target_ctx)) + return io_msg_exec_remote(req, io_msg_tw_complete); ret = -EOVERFLOW; if (target_ctx->flags & IORING_SETUP_IOPOLL) { @@ -202,14 +214,8 @@ static int io_msg_send_fd(struct io_kiocb *req, unsigned int issue_flags) req->flags |= REQ_F_NEED_CLEANUP; } - if (target_ctx->task_complete && current != target_ctx->submitter_task) { - init_task_work(&msg->tw, io_msg_tw_fd_complete); - if (task_work_add(target_ctx->submitter_task, &msg->tw, - TWA_SIGNAL)) - return -EOWNERDEAD; - - return IOU_ISSUE_SKIP_COMPLETE; - } + if (io_msg_need_remote(target_ctx)) + return io_msg_exec_remote(req, io_msg_tw_fd_complete); return io_msg_install_complete(req, issue_flags); } From patchwork Fri Jan 20 16:38:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13110209 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 835AEC05027 for ; Fri, 20 Jan 2023 16:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbjATQjH (ORCPT ); Fri, 20 Jan 2023 11:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbjATQjG (ORCPT ); Fri, 20 Jan 2023 11:39:06 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B06CCCC3D for ; Fri, 20 Jan 2023 08:39:03 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id s3so7431216edd.4 for ; Fri, 20 Jan 2023 08:39:02 -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=5Bd7WzrL7kKhumT1kMbsawZVX+I9bzaB968/+2/A8XE=; b=Y04ro4SBmR05q53HdPxCefG9Yg2zZ45apbEUvdZ2zcEns1YMWl8IvK3TOr+XvnNumQ BaGode/BQf7CyNZyRYMF6I2QbLAyeW5ejbLjCjuQZMFTecB8DLi20TyYgLThYlBBcp3r 9KmOJxRAeT6dTf9zlD+cki9GARQH8fBj+JKnazqltb+upADYNzc5/QEgAxnRFwHbrZzF fFTc1PgU0vd5QxItqrn8cP9VgIlZ3MuXzHzuA7f22fgCtM7D6BwRVySROf7xcjvw4Z3z dRFJMTZRBFn4NgKDozXCP/dFN3NaNeJQ9zOnDDvOPvrn+30JscTbai6ugHMo6Gbgpo74 bx9A== 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=5Bd7WzrL7kKhumT1kMbsawZVX+I9bzaB968/+2/A8XE=; b=1AhjTM5OcIre/o1VKm/ypyfZs4vO8EFlNbfug1ZkrBkkbLdmbjBQcksxhnlYMborBw AB6aA0kV54FFNdbXNpnNA18vz8GabASBCtkC25ZRUXN7VuFAVHCzHh0CCSDjoTCQbYHx 5eIdXOtfxe9aichUgtlB8Q838SXWgGsjuA+qfxwFbOajdoX47fGHhwmPtk4lA62eio8P OGE8/RTKtMol7nMC2VJojt0IVwe4kvl9y8wBdqtNzedUai0R081/pq/OUqLc0hmp+wES UXgAqVoyV5MqTvaf3+ymdwjZNV5cj4/sEUuw/pTS80JC/+U3EWaPAGQEpYGvoEk695Q8 +MxA== X-Gm-Message-State: AFqh2krsXsrM83T4VD2h2SHYYB5I8eZcT4ENI5dDyuhmgoLTnapYkrbF k+lkbyOJi9Gadea6khKh78BXJkkCFNM= X-Google-Smtp-Source: AMrXdXsQQWQIoCqFitua1AiDAxsTSKJGSMNIdBACMS2J7g7ESeXTS7atEPfc65QJ6TPRSjX2WsoqYw== X-Received: by 2002:a05:6402:f07:b0:493:b55d:d7f2 with SMTP id i7-20020a0564020f0700b00493b55dd7f2mr18768845eda.14.1674232741427; Fri, 20 Jan 2023 08:39:01 -0800 (PST) Received: from 127.com ([2620:10d:c092:600::2:4670]) by smtp.gmail.com with ESMTPSA id t27-20020a170906179b00b008762e2b7004sm4702124eje.208.2023.01.20.08.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 08:39:01 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-6.2 v2 2/3] io_uring/msg_ring: fix remote queue to disabled ring Date: Fri, 20 Jan 2023 16:38:06 +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 IORING_SETUP_R_DISABLED rings don't have the submitter task set, so it's not always safe to use ->submitter_task. Disallow posting msg_ring messaged to disabled rings. Also add task NULL check for loosy sync around testing for IORING_SETUP_R_DISABLED. Fixes: 6d043ee1164ca ("io_uring: do msg_ring in target task via tw") Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 4 ++-- io_uring/msg_ring.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 2ac1cd8d23ea..0a4efada9b3c 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3674,7 +3674,7 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p, if (ctx->flags & IORING_SETUP_SINGLE_ISSUER && !(ctx->flags & IORING_SETUP_R_DISABLED)) - ctx->submitter_task = get_task_struct(current); + WRITE_ONCE(ctx->submitter_task, get_task_struct(current)); file = io_uring_get_file(ctx); if (IS_ERR(file)) { @@ -3868,7 +3868,7 @@ static int io_register_enable_rings(struct io_ring_ctx *ctx) return -EBADFD; if (ctx->flags & IORING_SETUP_SINGLE_ISSUER && !ctx->submitter_task) - ctx->submitter_task = get_task_struct(current); + WRITE_ONCE(ctx->submitter_task, get_task_struct(current)); if (ctx->restrictions.registered) ctx->restricted = 1; diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c index bb868447dcdf..15602a136821 100644 --- a/io_uring/msg_ring.c +++ b/io_uring/msg_ring.c @@ -69,6 +69,10 @@ static int io_msg_exec_remote(struct io_kiocb *req, task_work_func_t func) { struct io_ring_ctx *ctx = req->file->private_data; struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); + struct task_struct *task = READ_ONCE(ctx->submitter_task); + + if (unlikely(!task)) + return -EOWNERDEAD; init_task_work(&msg->tw, func); if (task_work_add(ctx->submitter_task, &msg->tw, TWA_SIGNAL)) @@ -114,6 +118,8 @@ static int io_msg_ring_data(struct io_kiocb *req, unsigned int issue_flags) if (msg->src_fd || msg->dst_fd || msg->flags) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; if (io_msg_need_remote(target_ctx)) return io_msg_exec_remote(req, io_msg_tw_complete); @@ -206,6 +212,8 @@ static int io_msg_send_fd(struct io_kiocb *req, unsigned int issue_flags) if (target_ctx == ctx) return -EINVAL; + if (target_ctx->flags & IORING_SETUP_R_DISABLED) + return -EBADFD; if (!src_file) { src_file = io_msg_grab_file(req, issue_flags); if (!src_file) From patchwork Fri Jan 20 16:38:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13110207 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 290D4C38141 for ; Fri, 20 Jan 2023 16:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbjATQjH (ORCPT ); Fri, 20 Jan 2023 11:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjATQjG (ORCPT ); Fri, 20 Jan 2023 11:39:06 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD8BECDF9 for ; Fri, 20 Jan 2023 08:39:03 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id ud5so15402185ejc.4 for ; Fri, 20 Jan 2023 08:39:03 -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=gE9MO3GkkyiofAW2y8qFay5Pv9XYefZ9N3l0wWOfkt8=; b=BYDJioRHr86x2BWXEu/ZAp85zapovJfGmjqEI/GC+6LqhhLZI5LmtdPmOeX2uyZqlh oE9fgGE93nuACkZIZzf3c81Kb6doWsFOtO0C0v5c8X3DV7DzKXT/VBR6S1lHxj//Ijev i0bOGvsTUfpHN4hCQRaT3PmGZWiymTz2duw1wXQHXAMy5HMPHnnSlhZZfAVTgAT4M1ey YDzgyiyf93y5CFnrlksojRluUiFVLfxzFzJZ+FssvgnzIIa+WfMfcTwdM0uDoXoP95Z4 P68/O50rqrqFN8dEC6GLPVrogCpQgfhn9I3xmtgam++AWrezecuOyhPGWfCcIJLFYRaR 1Y7g== 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=gE9MO3GkkyiofAW2y8qFay5Pv9XYefZ9N3l0wWOfkt8=; b=tSsWZM96oVH+BNrUxF0Rzwfl5MeDB0gRS63BBuhK8P2kb4ON1ZYrsftS5K3dTtjdev CA1sT3aegwXWkNDlG8m9jaUiP/hDjDb3k62yBZSyOyjwNsBwiMr0TdJlhCOHXtQrsRgx AfcSbLpGDCcj57teb+h8BPuZ7C7sWTOCJrJJTJQkGCHGXn0UNHo0EbkEWIh6wxoPEOlm EzPxSx6qs3AycycNJSwdGPRPVi41G1VuMf74lXcnPDpcoOFIFmJXuUkx3pt1SCblhSCB p/OD03IW2lCbDnW915OaP9jKGuyE4B4iesVUeqYfRSEUI27eyAuXM1qkQ8ZCU0DcjL4w h9kA== X-Gm-Message-State: AFqh2krUtIAl7dO71Q3fHGPYmSku7k47Jp8+OL9AgPPw+x3IitUiZ3BR 7N46TaKBcXnwsT5+CiSA0gXrVJ/m/No= X-Google-Smtp-Source: AMrXdXtr3IrdDVepPo/qE+Jk7zkMGrsCm9j1Fs9+W+qv4VR6GzsekKYYozuV390x8/lPRZhJzHrzTQ== X-Received: by 2002:a17:907:6e05:b0:871:dd2:4afb with SMTP id sd5-20020a1709076e0500b008710dd24afbmr25165736ejc.42.1674232742183; Fri, 20 Jan 2023 08:39:02 -0800 (PST) Received: from 127.com ([2620:10d:c092:600::2:4670]) by smtp.gmail.com with ESMTPSA id t27-20020a170906179b00b008762e2b7004sm4702124eje.208.2023.01.20.08.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 08:39:01 -0800 (PST) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-6.2 v2 3/3] io_uring/msg_ring: optimise with correct tw notify method Date: Fri, 20 Jan 2023 16:38:07 +0000 Message-Id: <018a3d4ce4d8653dd6a6710b959c597b9f98f87e.1674232514.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 may want to use TWA_SIGNAL_NO_IPI instead of TWA_SIGNAL if the target ring is configured with IORING_SETUP_COOP_TASKRUN, change io_msg_exec_remote() to use the target ring's ->notify_method. The caveat is that we have to set IORING_SQ_TASKRUN if the rings asks for it. However, once task_work_add() succeeds the target ring might go away and so we grab a ctx reference to pin the ring until we set IORING_SQ_TASKRUN. Signed-off-by: Pavel Begunkov --- io_uring/msg_ring.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c index 15602a136821..af802cd645b4 100644 --- a/io_uring/msg_ring.c +++ b/io_uring/msg_ring.c @@ -70,15 +70,22 @@ static int io_msg_exec_remote(struct io_kiocb *req, task_work_func_t func) struct io_ring_ctx *ctx = req->file->private_data; struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); struct task_struct *task = READ_ONCE(ctx->submitter_task); + int ret = IOU_ISSUE_SKIP_COMPLETE; if (unlikely(!task)) return -EOWNERDEAD; + percpu_ref_get(&ctx->refs); init_task_work(&msg->tw, func); - if (task_work_add(ctx->submitter_task, &msg->tw, TWA_SIGNAL)) - return -EOWNERDEAD; - - return IOU_ISSUE_SKIP_COMPLETE; + if (task_work_add(ctx->submitter_task, &msg->tw, ctx->notify_method)) { + ret = -EOWNERDEAD; + goto out; + } + if (ctx->flags & IORING_SETUP_TASKRUN_FLAG) + atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags); +out: + percpu_ref_put(&ctx->refs); + return ret; } static void io_msg_tw_complete(struct callback_head *head)