diff options
author | Wanpeng Li <wanpengli@tencent.com> | 2020-01-13 03:50:27 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-01-28 23:36:57 +0300 |
commit | e938b9c94164e4d981039f1cf6007d7453883e5a (patch) | |
tree | 3ce4be9bc827fb32bd2ca38d71a5d6f601d5fe69 /Kbuild | |
parent | b562d140649966d4daedd0483a8fe59ad3bb465a (diff) | |
download | linux-e938b9c94164e4d981039f1cf6007d7453883e5a.tar.xz |
sched/nohz: Optimize get_nohz_timer_target()
On a machine, CPU 0 is used for housekeeping, the other 39 CPUs in the
same socket are in nohz_full mode. We can observe huge time burn in the
loop for seaching nearest busy housekeeper cpu by ftrace.
2) | get_nohz_timer_target() {
2) 0.240 us | housekeeping_test_cpu();
2) 0.458 us | housekeeping_test_cpu();
...
2) 0.292 us | housekeeping_test_cpu();
2) 0.240 us | housekeeping_test_cpu();
2) 0.227 us | housekeeping_any_cpu();
2) + 43.460 us | }
This patch optimizes the searching logic by finding a nearest housekeeper
CPU in the housekeeping cpumask, it can minimize the worst searching time
from ~44us to < 10us in my testing. In addition, the last iterated busy
housekeeper can become a random candidate while current CPU is a better
fallback if it is a housekeeper.
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/1578876627-11938-1-git-send-email-wanpengli@tencent.com
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions