Re: [PATCH 6.12 166/181] ring-buffer: Use current_context for safe per-CPU buffer swap
Sasha Levin <[email protected]>
| Newsgroups | dev.linux.lists.patches,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 19, 2026 at 01:50:50AM +0530, Harshit Mogalapalli wrote:
>This changes invalid CPU-mask, page-count, and sub-buffer-order results
>from -EINVAL to -EBUSY. I think update_max_tr_single() treats -EBUSY as
>an expected commit/resize collision.
Correct, thanks. Upstream only has the direct returns after f115d2b70bff
("ring-buffer: Remove jump to out label in ring_buffer_swap_cpu()"),
which first appeared in v6.16. There's a second bit of drift on top of
what you spotted: the patch also removes the "ret = -EBUSY;" assignment,
so on those trees the out_dec: paths (current_context busy, buffer
resizing) end up returning the earlier -EAGAIN instead of -EBUSY.
>Maybe we could be retaining ret = -EINVAL at declaration and assigning
>ret = -EBUSY immediately before the new current_context checks.
Rather than hand-adapting it, I've dropped this from the affected trees: 6.12,
6.6, 6.1, 5.15 and 5.10. 7.1 and 6.18 already carry f115d2b70bff, so the
backport is identical to upstream there and stays queued.
The race fix itself is fine on the older trees, so I'll look at requeuing it
with f115d2b70bff as a prerequisite.
--
Thanks,
Sasha