[PATCH linux-next 0/3] sched/psi: Optimize the process of updating triggers and rtpoll_total

From: yang.yang29
Date: Mon Oct 09 2023 - 08:20:27 EST


From: Yang Yang <yang.yang29@xxxxxxxxxx>

When psimon wakes up and there are no state changes for rtpoll_states,
it's unnecessary to update triggers and rtpoll_total because the pressures
being monitored by user have not changed. This will help to slightly reduce
unnecessary computations of psi.

There are also some minor related optimizations, please see below.

The parameter update_total in update_triggers() is useless now. Since if
changed_states & group->rtpoll_states is true, new_stall in update_triggers()
will be true, then update_total should also be true. We have no need for
update_total to help judgment whether to update rtpoll_total, so delete
update_total.

Update_triggers() always return now + group->rtpoll_min_period, and the
return value is only used by psi_rtpoll_work(), so change update_triggers()
to a void function, let group->rtpoll_next_update = now +
group->rtpoll_min_period directly.

Yang Yang(3):
sched/psi: Change update_triggers() to a void function
sched/psi: Avoid update triggers and rtpoll_total when it is unnecessary
sched/psi: Delete the function parameter update_total of update_triggers()

kernel/sched/psi.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)

--
2.25.1