Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/psi: Change update_triggers() to a 'void' function

Update_triggers() always returns 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.

This will avoid unnecessary function return value passing & simplifies
the function.

[ mingo: Updated changelog ]

Suggested-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/202310092024289721617@zte.com.cn

authored by

Yang Yang and committed by
Ingo Molnar
e03dc9fa 5b77261c

+3 -4
+3 -4
kernel/sched/psi.c
··· 434 434 return growth; 435 435 } 436 436 437 - static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total, 437 + static void update_triggers(struct psi_group *group, u64 now, bool *update_total, 438 438 enum psi_aggregators aggregator) 439 439 { 440 440 struct psi_trigger *t; ··· 503 503 /* Reset threshold breach flag once event got generated */ 504 504 t->pending_event = false; 505 505 } 506 - 507 - return now + group->rtpoll_min_period; 508 506 } 509 507 510 508 static u64 update_averages(struct psi_group *group, u64 now) ··· 704 706 } 705 707 706 708 if (now >= group->rtpoll_next_update) { 707 - group->rtpoll_next_update = update_triggers(group, now, &update_total, PSI_POLL); 709 + update_triggers(group, now, &update_total, PSI_POLL); 710 + group->rtpoll_next_update = now + group->rtpoll_min_period; 708 711 if (update_total) 709 712 memcpy(group->rtpoll_total, group->total[PSI_POLL], 710 713 sizeof(group->rtpoll_total));