diff options
author | Peter Zijlstra <peterz@infradead.org> | 2025-03-08 17:48:34 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2025-03-13 12:07:17 +0100 |
commit | 538d710ec74233f99dc0fd604d45a2b6143c8e2c (patch) | |
tree | 6708b608fb190904de07919197bba838b3cc3a98 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 1d25bdd3f3831bb1b9512d4b5afcd2dea8a0c515 (diff) |
posix-timers: Make lock_timer() use guard()
The lookup and locking of posix timers requires the same repeating pattern
at all usage sites:
tmr = lock_timer(tiner_id);
if (!tmr)
return -EINVAL;
....
unlock_timer(tmr);
Solve this with a guard implementation, which works in most places out of
the box except for those, which need to unlock the timer inside the guard
scope.
Though the only places where this matters are timer_delete() and
timer_settime(). In both cases the timer pointer needs to be preserved
across the end of the scope, which is solved by storing the pointer in a
variable outside of the scope.
timer_settime() also has to protect the timer with RCU before unlocking,
which obviously can't use guard(rcu) before leaving the guard scope as that
guard is cleaned up before the unlock. Solve this by providing the RCU
protection open coded.
[ tglx: Made it work and added change log ]
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/all/20250224162103.GD11590@noisy.programming.kicks-ass.net
Link: https://lore.kernel.org/all/20250308155624.087465658@linutronix.de
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions