mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ring-buffer: Clean up resize_disabled checks
@ 2026-09-16 15:28 Vincent Donnefort
  2026-09-16 15:28 ` [PATCH v2 1/2] " Vincent Donnefort
  2026-09-16 15:28 ` [PATCH v2 2/2] ring-buffer: Remove unnecessary cpumask_test_cpu Vincent Donnefort
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Donnefort @ 2026-09-16 15:28 UTC (permalink / raw)
  To: rostedt, mhiramat, linux-trace-kernel
  Cc: mathieu.desnoyers, kernel-team, linux-kernel, devnexen,
	Vincent Donnefort

ring_buffer_subbuf_order_set() checks for resize_disabled twice under
the same buffer->mutex hold. Moreover, this check duplicates the logic
in ring_buffer_resize(). Create a common helper rb_resize_disabled() to
factor out this code and drop redundant checks.

Additionally, remove the unnecessary cpumask_test_cpu() in
ring_buffer_subbuf_order_set() as for_each_buffer_cpu() already
iterates over buffer->cpumask.

v2:
  - Split cpumask_test_cpu() cleanup into its own patch (Steven)
  - Remove another unnecessary cpumask_test_cpu() (David)

v1: https://lore.kernel.org/all/20260914175907.1027349-1-vdonnefort@google.com/

Vincent Donnefort (2):
  ring-buffer: Clean up resize_disabled checks
  ring-buffer: Remove unnecessary cpumask_test_cpu

 kernel/trace/ring_buffer.c | 70 +++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 42 deletions(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
-- 
2.55.0.1082.g2b9226bbc0-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-16 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 15:28 [PATCH v2 0/2] ring-buffer: Clean up resize_disabled checks Vincent Donnefort
2026-09-16 15:28 ` [PATCH v2 1/2] " Vincent Donnefort
2026-09-16 15:28 ` [PATCH v2 2/2] ring-buffer: Remove unnecessary cpumask_test_cpu Vincent Donnefort

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®