]> git.baikalelectronics.ru Git - kernel.git/commit
psi: Use ONCPU state tracking machinery to detect reclaim
authorChengming Zhou <zhouchengming@bytedance.com>
Wed, 3 Mar 2021 03:46:57 +0000 (11:46 +0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 6 Mar 2021 11:40:22 +0000 (12:40 +0100)
commit3cc7c4329cd0597875d6a31719e2d44cc128ed29
tree20d9f241fb2f7d4cff8517b0749acf3c8aca3b4d
parent615dcc3d75bc0e77cd1369fefcf1d81b62fe946a
psi: Use ONCPU state tracking machinery to detect reclaim

Move the reclaim detection from the timer tick to the task state
tracking machinery using the recently added ONCPU state. And we
also add task psi_flags changes checking in the psi_task_switch()
optimization to update the parents properly.

In terms of performance and cost, this ONCPU task state tracking
is not cheaper than previous timer tick in aggregate. But the code is
simpler and shorter this way, so it's a maintainability win. And
Johannes did some testing with perf bench, the performace and cost
changes would be acceptable for real workloads.

Thanks to Johannes Weiner for pointing out the psi_task_switch()
optimization things and the clearer changelog.

Co-developed-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lkml.kernel.org/r/20210303034659.91735-3-zhouchengming@bytedance.com
include/linux/psi.h
kernel/sched/core.c
kernel/sched/psi.c
kernel/sched/stats.h