diff options
| author | Vlastimil Babka <[email protected]> | 2024-11-05 11:34:57 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-11-12 01:22:28 +0000 |
| commit | 9b5c87d47949292ff21ee2fadd1e83820662a430 (patch) | |
| tree | fda19b186ede122d39e2784814597b07729c23bd /rust/helpers/security.c | |
| parent | zram: ZRAM_DEF_COMP should depend on ZRAM (diff) | |
| download | kernel-9b5c87d47949292ff21ee2fadd1e83820662a430.tar.gz kernel-9b5c87d47949292ff21ee2fadd1e83820662a430.zip | |
mm: mmap_lock: check trace_mmap_lock_$type_enabled() instead of regcount
Since 7d6be67cfdd4 ("mm: mmap_lock: replace get_memcg_path_buf() with
on-stack buffer") we use trace_mmap_lock_reg()/unreg() only to maintain an
atomic reg_refcount which is checked to avoid performing
get_mm_memcg_path() in case none of the tracepoints using it is enabled.
This can be achieved directly by putting all the work needed for the
tracepoint behind the trace_mmap_lock_##type##_enabled(), as suggested by
Documentation/trace/tracepoints.rst and with the following advantages:
- uses the tracepoint's static key instead of evaluating a branch
- the check tracepoint specific, not shared by all of them
- we can get rid of trace_mmap_lock_reg()/unreg() completely
Thus use the trace_..._enabled() check and remove unnecessary code.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Vlastimil Babka <[email protected]>
Reviewed-by: Axel Rasmussen <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'rust/helpers/security.c')
0 files changed, 0 insertions, 0 deletions
