mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
Revert "sched/psi: Extract update_triggers side effect"
This reverts commitfb4bc32fc1which is commit4468fcae49upstream. It is part of a patch series that breaks the Android API. If this series is needed in Android devices in the future, it can come back in an ABI-safe manner. Bug: 161946584 Change-Id: I6869017fade6bcd138d5132b80da688012436887 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -430,11 +430,11 @@ static u64 window_update(struct psi_window *win, u64 now, u64 value)
|
|||||||
return growth;
|
return growth;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total)
|
static u64 update_triggers(struct psi_group *group, u64 now)
|
||||||
{
|
{
|
||||||
struct psi_trigger *t;
|
struct psi_trigger *t;
|
||||||
|
bool update_total = false;
|
||||||
u64 *total = group->total[PSI_POLL];
|
u64 *total = group->total[PSI_POLL];
|
||||||
*update_total = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On subsequent updates, calculate growth deltas and let
|
* On subsequent updates, calculate growth deltas and let
|
||||||
@@ -462,7 +462,7 @@ static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total)
|
|||||||
* been through all of them. Also remember to extend the
|
* been through all of them. Also remember to extend the
|
||||||
* polling time if we see new stall activity.
|
* polling time if we see new stall activity.
|
||||||
*/
|
*/
|
||||||
*update_total = true;
|
update_total = true;
|
||||||
|
|
||||||
/* Calculate growth since last update */
|
/* Calculate growth since last update */
|
||||||
growth = window_update(&t->win, now, total[t->state]);
|
growth = window_update(&t->win, now, total[t->state]);
|
||||||
@@ -485,6 +485,10 @@ static u64 update_triggers(struct psi_group *group, u64 now, bool *update_total)
|
|||||||
t->pending_event = false;
|
t->pending_event = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (update_total)
|
||||||
|
memcpy(group->rtpoll_total, total,
|
||||||
|
sizeof(group->rtpoll_total));
|
||||||
|
|
||||||
return now + group->rtpoll_min_period;
|
return now + group->rtpoll_min_period;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +622,6 @@ static void psi_rtpoll_work(struct psi_group *group)
|
|||||||
{
|
{
|
||||||
bool force_reschedule = false;
|
bool force_reschedule = false;
|
||||||
u32 changed_states;
|
u32 changed_states;
|
||||||
bool update_total;
|
|
||||||
u64 now;
|
u64 now;
|
||||||
|
|
||||||
mutex_lock(&group->rtpoll_trigger_lock);
|
mutex_lock(&group->rtpoll_trigger_lock);
|
||||||
@@ -683,12 +686,8 @@ static void psi_rtpoll_work(struct psi_group *group)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (now >= group->rtpoll_next_update) {
|
if (now >= group->rtpoll_next_update)
|
||||||
group->rtpoll_next_update = update_triggers(group, now, &update_total);
|
group->rtpoll_next_update = update_triggers(group, now);
|
||||||
if (update_total)
|
|
||||||
memcpy(group->rtpoll_total, group->total[PSI_POLL],
|
|
||||||
sizeof(group->rtpoll_total));
|
|
||||||
}
|
|
||||||
|
|
||||||
psi_schedule_rtpoll_work(group,
|
psi_schedule_rtpoll_work(group,
|
||||||
nsecs_to_jiffies(group->rtpoll_next_update - now) + 1,
|
nsecs_to_jiffies(group->rtpoll_next_update - now) + 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user