diff options
author | Peter Zijlstra <[email protected]> | 2020-05-11 14:13:00 +0200 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2020-11-10 18:38:57 +0100 |
commit | 565790d28b1e33ee2f77bad5348b99f6dfc366fd (patch) | |
tree | 179b55e6e483c0daf2975f95ccf57401fad0e7d6 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | a8b62fd0850503cf1e557d7e5a98d3f1f5c25eef (diff) |
sched: Fix balance_callback()
The intent of balance_callback() has always been to delay executing
balancing operations until the end of the current rq->lock section.
This is because balance operations must often drop rq->lock, and that
isn't safe in general.
However, as noted by Scott, there were a few holes in that scheme;
balance_callback() was called after rq->lock was dropped, which means
another CPU can interleave and touch the callback list.
Rework code to call the balance callbacks before dropping rq->lock
where possible, and otherwise splice the balance list onto a local
stack.
This guarantees that the balance list must be empty when we take
rq->lock. IOW, we'll only ever run our own balance callbacks.
Reported-by: Scott Wood <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Valentin Schneider <[email protected]>
Reviewed-by: Daniel Bristot de Oliveira <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions