diff options
| author | Tetsuo Handa <[email protected]> | 2024-06-21 10:08:41 +0900 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-07-03 19:30:26 -0700 |
| commit | 7d6be67cfdd4a53cea7147313ca13c531e3a470f (patch) | |
| tree | 66ae4de522af3f66318e9c6ac4024e66e8af559f /tools/perf/scripts/python/parallel-perf.py | |
| parent | b1a80f4be7691a1ea007e24ebb3c8ca2e4a20f00 (diff) | |
mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer
Commit 2b5067a8143e ("mm: mmap_lock: add tracepoints around lock
acquisition") introduced TRACE_MMAP_LOCK_EVENT() macro using
preempt_disable() in order to let get_mm_memcg_path() return a percpu
buffer exclusively used by normal, softirq, irq and NMI contexts
respectively.
Commit 832b50725373 ("mm: mmap_lock: use local locks instead of disabling
preemption") replaced preempt_disable() with local_lock(&memcg_paths.lock)
based on an argument that preempt_disable() has to be avoided because
get_mm_memcg_path() might sleep if PREEMPT_RT=y.
But syzbot started reporting
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
and
inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
messages, for local_lock() does not disable IRQ.
We could replace local_lock() with local_lock_irqsave() in order to
suppress these messages. But this patch instead replaces percpu buffers
with on-stack buffer, for the size of each buffer returned by
get_memcg_path_buf() is only 256 bytes which is tolerable for allocating
from current thread's kernel stack memory.
Link: https://lkml.kernel.org/r/[email protected]
Reported-by: syzbot <[email protected]>
Closes: https://syzkaller.appspot.com/bug?extid=40905bca570ae6784745
Fixes: 832b50725373 ("mm: mmap_lock: use local locks instead of disabling preemption")
Signed-off-by: Tetsuo Handa <[email protected]>
Reviewed-by: Axel Rasmussen <[email protected]>
Cc: Nicolas Saenz Julienne <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions