summaryrefslogtreecommitdiff
path: root/lib/logic_pio.c
diff options
context:
space:
mode:
authorYicong Yang <yangyicong@hisilicon.com>2023-10-19 11:33:23 +0800
committerPeter Zijlstra <peterz@infradead.org>2023-10-24 10:38:43 +0200
commit22165f61d0c4092adf40f967c899e5d8b8a0d703 (patch)
tree04b5d112e747b5bbe57b901d96a1f8e50bee55a8 /lib/logic_pio.c
parent8881e1639f1f899b64e9bccf6cc14d51c1d3c822 (diff)
downloadlinux-22165f61d0c4092adf40f967c899e5d8b8a0d703.tar.gz
linux-22165f61d0c4092adf40f967c899e5d8b8a0d703.tar.bz2
linux-22165f61d0c4092adf40f967c899e5d8b8a0d703.zip
sched/fair: Use candidate prev/recent_used CPU if scanning failed for cluster wakeup
Chen Yu reports a hackbench regression of cluster wakeup when hackbench threads equal to the CPU number [1]. Analysis shows it's because we wake up more on the target CPU even if the prev_cpu is a good wakeup candidate and leads to the decrease of the CPU utilization. Generally if the task's prev_cpu is idle we'll wake up the task on it without scanning. On cluster machines we'll try to wake up the task in the same cluster of the target for better cache affinity, so if the prev_cpu is idle but not sharing the same cluster with the target we'll still try to find an idle CPU within the cluster. This will improve the performance at low loads on cluster machines. But in the issue above, if the prev_cpu is idle but not in the cluster with the target CPU, we'll try to scan an idle one in the cluster. But since the system is busy, we're likely to fail the scanning and use target instead, even if the prev_cpu is idle. Then leads to the regression. This patch solves this in 2 steps: o record the prev_cpu/recent_used_cpu if they're good wakeup candidates but not sharing the cluster with the target. o on scanning failure use the prev_cpu/recent_used_cpu if they're recorded as idle [1] https://lore.kernel.org/all/ZGzDLuVaHR1PAYDt@chenyu5-mobl1/ Closes: https://lore.kernel.org/all/ZGsLy83wPIpamy6x@chenyu5-mobl1/ Reported-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Tested-and-reviewed-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org> Link: https://lkml.kernel.org/r/20231019033323.54147-4-yangyicong@huawei.com
Diffstat (limited to 'lib/logic_pio.c')
0 files changed, 0 insertions, 0 deletions