summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTvrtko Ursulin <tursulin@ursulin.net>2024-06-25 14:50:00 +0100
committerPeter Zijlstra <peterz@infradead.org>2024-07-04 15:59:52 +0200
commit0ec208ce9834929769ace0e2a506106192d08069 (patch)
treef0924a78d9ee4b1f195214548de86063d1ae23af /include
parentc793a62823d1ce8f70d9cfc7803e3ea436277cda (diff)
sched/psi: Optimise psi_group_change a bit
The current code loops over the psi_states only to call a helper which then resolves back to the action needed for each state using a switch statement. That is effectively creating a double indirection of a kind which, given how all the states need to be explicitly listed and handled anyway, we can simply remove. Both the for loop and the switch statement that is. The benefit is both in the code size and CPU time spent in this function. YMMV but on my Steam Deck, while in a game, the patch makes the CPU usage go from ~2.4% down to ~1.2%. Text size at the same time went from 0x323 to 0x2c1. Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Link: https://lkml.kernel.org/r/20240625135000.38652-1-tursulin@igalia.com
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions