The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] local_lock: Move this_cpu_ptr() notation from internal to main header
@ 2025-05-14 11:07 Sebastian Andrzej Siewior
  2025-05-14 11:07 ` [PATCH 1/2] " Sebastian Andrzej Siewior
  2025-05-14 11:07 ` [PATCH 2/2] cryptd: Use nested-BH locking for cryptd_cpu_queue Sebastian Andrzej Siewior
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-05-14 11:07 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel
  Cc: tglx, Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
	Boqun Feng, Alexei Starovoitov, Sebastian Andrzej Siewior

While looking at what needs extra locks for PREEMPT_RT in order to rid
of the lock in local_bh_disable() I stumbled uppon two users which need
to lock the structure but the pointer is no longer per_cpu.

Patch #1 moves this_cpu_ptr() from the internal header to the main on in
         order to free the name space and have the __ prefix function to
	 do the same but without the this_cpu_ptr(). So
	   local_lock_nested_bh()   -> on per-CPU memory
	   __local_lock_nested_bh() -> on local memory.

         This change has been made to all local_lock*() functions.

Patch #2 is an example why it is needed. In a nutshell the per-CPU
         memory is allocated via alloc_percpu() and then the memory is
	 passed to queue_work_on(). The worker then retrieves the
	 structure via container_of(). No more per-CPU memory.

I attached #2 as an example and would route via crypto once #1 is
accepted. The user user I identified is nf_set_pipapo which is doing
something similar. This makes two users in total.

Sebastian Andrzej Siewior (2):
  local_lock: Move this_cpu_ptr() notation from internal to main header.
  cryptd: Use nested-BH locking for cryptd_cpu_queue

 crypto/cryptd.c                     |  6 ++++++
 include/linux/local_lock.h          | 20 +++++++++----------
 include/linux/local_lock_internal.h | 30 ++++++++++++++---------------
 3 files changed, 31 insertions(+), 25 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-05-18  9:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14 11:07 [PATCH 0/2] local_lock: Move this_cpu_ptr() notation from internal to main header Sebastian Andrzej Siewior
2025-05-14 11:07 ` [PATCH 1/2] " Sebastian Andrzej Siewior
2025-05-15  0:46   ` Alexei Starovoitov
2025-05-18  9:42     ` Sebastian Andrzej Siewior
2025-05-14 11:07 ` [PATCH 2/2] cryptd: Use nested-BH locking for cryptd_cpu_queue Sebastian Andrzej Siewior
2025-05-14 11:09   ` Sebastian Andrzej Siewior

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