fix lock inversion in lockless sys_times()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | seqlock: add irqsave variant of read_seqbegin_or_lockinclude/ | +17 | 0 replies | |
| 2/2 | sched,time: fix lock inversion in thread_group_cputimekernel/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH -tip 0/2] fix lock inversion in lockless sys_times()
The sig->stats_lock nests inside the tasklist_lock and the sighand->siglock in __exit_signal and wait_task_zombie.
However, both of those locks can be taken from irq context, which means we need to use the interrupt safe variant of read_seqbegin_or_lock. This blocks interrupts when the "lock" branch is taken (seq is odd), preventing the lock inversion.
On the first (lockless) pass through the loop, irqs are not blocked.
This fixes the lockdep complaints that Stanislaw reported.