From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379506; b=4lzMrQNJCKVjLZtZrehIWBMff3d20gFJWoZA8eVhLuKEaCcpA7BzYV/p3MhgadPU9WHd FY4pCeuDmDUEaDHikO77dg2Ca6X/b0+UxK4IzMXNDPyRBZ3n+O3P71uZ0dGRSu+OV0KxX 0I+nDtJk/MiIv6uJAtgeXeqMV+d87a9NDWmh9SovBA9qQA6vAcucQ+LUc6Ij/6PoaJdUJ E/ktD5mDpAF6zDmTr0AkysIO6mtwkWn0PbS9/X6B4o66lspL3VbdkH55tskcLyAauy6BJ h3KqGw2bm82rzU/rA4cy3uGUXqyiAG0uLec+L1DfH3eQ5rAid5BrlowSR3ZFlU6SRZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379506; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=vQar2qmdZe8PxwmkW4H+dXrCPVrlxnL83dAeBY2cQgk=; b=maYAIjWih68zu4bDDfEhdWi/V7IrSbx86PIirAFNpOKRP8R9G4TyiJlVB5qO6CDOMIIx YqrZXD3zoSR7eQMkYeo9/sZCFZuX2nQuUlomuGrVQI4VDDiZYcp/JEXJ6F6J+IiaeicZX JwceOVrfktddb2+/NMidStWFcTujA+RVgfadhrAEHi0lwkZ09wfehW2p46At79mZOLyWm Mx/BjUGA9GKb+e5DokT3AFXNP4oMYOoEtr5ZckvfDHUDKQPJxMTvlLAovmrCawxUy7lQy RzZZccHUuzNmKK82S/THoNny5lDIgUVVUJ42tYyjJsAb7KZv2HvlfzJfprhNwHPCLLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=n8YaVJ4e; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7406606A322; Fri, 4 Dec 2026 10:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=n8YaVJ4e Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25E3C1F000C2; Fri, 4 Dec 2026 10:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379506; bh=vQar2qmdZe8PxwmkW4H+dXrCPVrlxnL83dAeBY2cQgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n8YaVJ4e2DNWK4LUZBaW2N6/S4rAdfO5WTNNUBHdjfRlGsvOQbMn7LBZKwt3zandA q21+wEa3bMtEDbOm+B5COjoKcRuvxa3G2paypLGS5YHGomly1kN4MWdOjZncT/ZT2W /Bir2NyCTL1Vg5Exe7P7KV7vDbVSrWUBQdJhXyPI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0022/1167] io_uring: pass in counter to handle_tw_list() rather than return it Date: Fri, 4 Dec 2026 18:50:49 +0900 Message-ID: <20261204100702.624221839@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe Commit 2708af1adc11700c6c3ce4109e3b133079a36a78 upstream. No functional changes in this patch, just in preparation for returning something other than count from this helper. Signed-off-by: Jens Axboe [axboe: 6.6 runs normal task_work in LIFO order, as it doesn't have 170539bdf109 ("io_uring: handle traditional task_work in FIFO order"), so call handle_tw_list() without llist_reverse_order()] Signed-off-by: Sasha Levin --- io_uring/io_uring.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 96474d9ebef82..ddae460e06c05 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1197,11 +1197,10 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx, struct io_tw_state *ts) percpu_ref_put(&ctx->refs); } -static unsigned int handle_tw_list(struct llist_node *node) +static void handle_tw_list(struct llist_node *node, unsigned int *count) { struct io_ring_ctx *ctx = NULL; struct io_tw_state ts = { }; - unsigned int count = 0; do { struct llist_node *next = node->next; @@ -1221,7 +1220,7 @@ static unsigned int handle_tw_list(struct llist_node *node) io_poll_task_func, io_req_rw_complete, req, &ts); node = next; - count++; + (*count)++; if (unlikely(need_resched())) { ctx_flush_and_put(ctx, &ts); ctx = NULL; @@ -1230,7 +1229,6 @@ static unsigned int handle_tw_list(struct llist_node *node) } while (node); ctx_flush_and_put(ctx, &ts); - return count; } /** @@ -1290,7 +1288,7 @@ void tctx_task_work(struct callback_head *cb) node = llist_del_all(&tctx->task_list); if (node) - count = handle_tw_list(node); + handle_tw_list(node, &count); /* relaxed read is enough as only the task itself sets ->in_cancel */ if (unlikely(atomic_read(&tctx->in_cancel))) -- 2.53.0