Skip to content

percpu-rwsem: introduce percpu_rw_semaphore->recursive mode

Oleg Nesterov lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rcusync: introduce rcu_sync_struct->exclusive modeinclude/linux/percpu-rwsem.h include/linux/rcusync.h kernel/locking/percpu-rwsem.c +1 more+38 -200 replies
2/3percpu-rwsem: don't use percpu_rw_semaphore->rw_sem to exclude writerskernel/locking/percpu-rwsem.c+1 -20 replies
3/3percpu-rwsem: introduce percpu_rw_semaphore->recursive modeinclude/linux/percpu-rwsem.h kernel/events/uprobes.c kernel/locking/percpu-rwsem.c+22 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] percpu-rwsem: introduce percpu_rw_semaphore->recursive mode
Quoted 4 lines · Oleg Nesterov

So we need percpu_down_write_dont_block_readers(). I already thought about this before, I'll try to make the patch tomorrow on top of your changes.

Never say tomorrow...

Quoted 3 lines

This means that we do not need task_struct->cpuhp_ref, but we can't avoid livelock we currently have: cpu_hotplug_begin() can never succeed if the new readers come fast enough.

Like with any other "recursive" lock.

Peter, I know you don't like the 1st patch. And yes, we could add another mutex into percpu_rw_semaphore instead. But I think it would be better to rely on rcu_sync_enter(). As for completion, we can remove it later. Nevermind, the actual change is 3/3 and it looks simple.

Oleg.