Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Jens Axboe <axboe@kernel.dk>,
	Sasha Levin <sashal@kernel.org>
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	[thread overview]
Message-ID: <20261204100702.624221839@linuxfoundation.org> (raw)
In-Reply-To: <20261204100702.047403948@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jens Axboe <axboe@kernel.dk>

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@kernel.dk>
[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 <sashal@kernel.org>
---
 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




  parent reply	other threads:[~2026-12-04 10:18 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:50 [PATCH 6.6 0000/1167] 6.6.164-rc1 review Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0001/1167] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0002/1167] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0003/1167] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0004/1167] drm/amdgpu: Check cs flags Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0005/1167] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0006/1167] bpf: Drop inet_conn_established from lsm sleepable hooks Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0007/1167] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0008/1167] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0009/1167] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0010/1167] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0011/1167] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0012/1167] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0013/1167] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0014/1167] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0015/1167] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0016/1167] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0017/1167] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0018/1167] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0019/1167] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0020/1167] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0021/1167] io_uring: cleanup handle_tw_list() calling convention Greg Kroah-Hartman
2026-12-04  9:50 ` Greg Kroah-Hartman [this message]
2026-12-04  9:50 ` [PATCH 6.6 0023/1167] io_uring/sqpoll: manage task_work privately Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0025/1167] io_uring/sqpoll: use the correct check for pending task_work Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0027/1167] io_uring/sqpoll: ensure that normal task_work is also run timely Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0028/1167] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0029/1167] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0030/1167] io_uring: dont touch sqd->thread off tw add Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0031/1167] io_uring/sqpoll: zero sqd->thread on tctx errors Greg Kroah-Hartman
2026-12-04  9:50 ` [PATCH 6.6 0032/1167] io_uring/sqpoll: Increase task_work submission batch size Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0033/1167] io_uring: fix task_work add use-after-free with SQPOLL Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0034/1167] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0035/1167] net: sfp: add quirk for Lantech 8330-265D Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0036/1167] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0037/1167] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0038/1167] fs/9p: switch vfsmount to use v9fs_get_new_inode Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0039/1167] fs/9p: rework qid2ino logic Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0040/1167] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0041/1167] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0042/1167] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0043/1167] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0044/1167] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0045/1167] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0046/1167] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0047/1167] 9p: do not store the create fid on special files Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0048/1167] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0049/1167] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0051/1167] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0052/1167] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0053/1167] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0054/1167] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0055/1167] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0056/1167] net: ethernet: mtk_wed: introduce versioning utility routines Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0057/1167] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0058/1167] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0059/1167] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0060/1167] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0061/1167] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0062/1167] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0063/1167] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0064/1167] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-12-04  9:51 ` [PATCH 6.6 0065/1167] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204100702.624221839@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=axboe@kernel.dk \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox