Skip to content

Commit 3657680

Browse files
yangyang20220519Ingo Molnar
authored andcommitted
sched/psi: Delete the 'update_total' function parameter from update_triggers()
The 'update_total' parameter of update_triggers() is always true after the previous commit: 80cc1d1 ("sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes") If the 'changed_states & group->rtpoll_states' condition is true, 'new_stall' in update_triggers() will be true, and then 'update_total' should also be true. So update_total is redundant - remove it. [ mingo: Changelog updates ] Signed-off-by: Yang Yang <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Peter Ziljstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 80cc1d1 commit 3657680

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

kernel/sched/psi.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,13 @@ static u64 window_update(struct psi_window *win, u64 now, u64 value)
434434
return growth;
435435
}
436436

437-
static void update_triggers(struct psi_group *group, u64 now, bool *update_total,
437+
static void update_triggers(struct psi_group *group, u64 now,
438438
enum psi_aggregators aggregator)
439439
{
440440
struct psi_trigger *t;
441441
u64 *total = group->total[aggregator];
442442
struct list_head *triggers;
443443
u64 *aggregator_total;
444-
*update_total = false;
445444

446445
if (aggregator == PSI_AVGS) {
447446
triggers = &group->avg_triggers;
@@ -471,14 +470,6 @@ static void update_triggers(struct psi_group *group, u64 now, bool *update_total
471470
* events without dropping any).
472471
*/
473472
if (new_stall) {
474-
/*
475-
* Multiple triggers might be looking at the same state,
476-
* remember to update group->polling_total[] once we've
477-
* been through all of them. Also remember to extend the
478-
* polling time if we see new stall activity.
479-
*/
480-
*update_total = true;
481-
482473
/* Calculate growth since last update */
483474
growth = window_update(&t->win, now, total[t->state]);
484475
if (!t->pending_event) {
@@ -563,7 +554,6 @@ static void psi_avgs_work(struct work_struct *work)
563554
struct delayed_work *dwork;
564555
struct psi_group *group;
565556
u32 changed_states;
566-
bool update_total;
567557
u64 now;
568558

569559
dwork = to_delayed_work(work);
@@ -582,7 +572,7 @@ static void psi_avgs_work(struct work_struct *work)
582572
* go - see calc_avgs() and missed_periods.
583573
*/
584574
if (now >= group->avg_next_update) {
585-
update_triggers(group, now, &update_total, PSI_AVGS);
575+
update_triggers(group, now, PSI_AVGS);
586576
group->avg_next_update = update_averages(group, now);
587577
}
588578

@@ -638,7 +628,6 @@ static void psi_rtpoll_work(struct psi_group *group)
638628
{
639629
bool force_reschedule = false;
640630
u32 changed_states;
641-
bool update_total;
642631
u64 now;
643632

644633
mutex_lock(&group->rtpoll_trigger_lock);
@@ -705,7 +694,7 @@ static void psi_rtpoll_work(struct psi_group *group)
705694

706695
if (now >= group->rtpoll_next_update) {
707696
if (changed_states & group->rtpoll_states) {
708-
update_triggers(group, now, &update_total, PSI_POLL);
697+
update_triggers(group, now, PSI_POLL);
709698
memcpy(group->rtpoll_total, group->total[PSI_POLL],
710699
sizeof(group->rtpoll_total));
711700
}

0 commit comments

Comments
 (0)