mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 20:59:37 +02:00
Revert "sched: Move psi_account_irqtime() out of update_rq_clock_task() hotpath"
This reverts commit448a2500d1
which is commitddae0ca2a8
upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Ic0a5374d87a5982ac8656952baf699479090e8ec Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
c572fee3c0
commit
ff00229c77
|
@ -742,6 +742,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
|
||||||
|
|
||||||
rq->prev_irq_time += irq_delta;
|
rq->prev_irq_time += irq_delta;
|
||||||
delta -= irq_delta;
|
delta -= irq_delta;
|
||||||
|
psi_account_irqtime(rq->curr, irq_delta);
|
||||||
delayacct_irq(rq->curr, irq_delta);
|
delayacct_irq(rq->curr, irq_delta);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
|
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
|
||||||
|
@ -5778,7 +5779,7 @@ void scheduler_tick(void)
|
||||||
{
|
{
|
||||||
int cpu = smp_processor_id();
|
int cpu = smp_processor_id();
|
||||||
struct rq *rq = cpu_rq(cpu);
|
struct rq *rq = cpu_rq(cpu);
|
||||||
struct task_struct *curr;
|
struct task_struct *curr = rq->curr;
|
||||||
struct rq_flags rf;
|
struct rq_flags rf;
|
||||||
unsigned long thermal_pressure;
|
unsigned long thermal_pressure;
|
||||||
u64 resched_latency;
|
u64 resched_latency;
|
||||||
|
@ -5790,9 +5791,6 @@ void scheduler_tick(void)
|
||||||
|
|
||||||
rq_lock(rq, &rf);
|
rq_lock(rq, &rf);
|
||||||
|
|
||||||
curr = rq->curr;
|
|
||||||
psi_account_irqtime(rq, curr, NULL);
|
|
||||||
|
|
||||||
update_rq_clock(rq);
|
update_rq_clock(rq);
|
||||||
trace_android_rvh_tick_entry(rq);
|
trace_android_rvh_tick_entry(rq);
|
||||||
|
|
||||||
|
@ -6837,7 +6835,6 @@ static void __sched notrace __schedule(unsigned int sched_mode)
|
||||||
++*switch_count;
|
++*switch_count;
|
||||||
|
|
||||||
migrate_disable_switch(rq, prev);
|
migrate_disable_switch(rq, prev);
|
||||||
psi_account_irqtime(rq, prev, next);
|
|
||||||
psi_sched_switch(prev, next, !task_on_rq_queued(prev));
|
psi_sched_switch(prev, next, !task_on_rq_queued(prev));
|
||||||
|
|
||||||
trace_sched_switch(sched_mode & SM_MASK_PREEMPT, prev, next, prev_state);
|
trace_sched_switch(sched_mode & SM_MASK_PREEMPT, prev, next, prev_state);
|
||||||
|
|
|
@ -790,7 +790,6 @@ static void psi_group_change(struct psi_group *group, int cpu,
|
||||||
enum psi_states s;
|
enum psi_states s;
|
||||||
u32 state_mask;
|
u32 state_mask;
|
||||||
|
|
||||||
lockdep_assert_rq_held(cpu_rq(cpu));
|
|
||||||
groupc = per_cpu_ptr(group->pcpu, cpu);
|
groupc = per_cpu_ptr(group->pcpu, cpu);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1009,29 +1008,19 @@ void psi_task_switch(struct task_struct *prev, struct task_struct *next,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
||||||
void psi_account_irqtime(struct rq *rq, struct task_struct *curr, struct task_struct *prev)
|
void psi_account_irqtime(struct task_struct *task, u32 delta)
|
||||||
{
|
{
|
||||||
int cpu = task_cpu(curr);
|
int cpu = task_cpu(task);
|
||||||
struct psi_group *group;
|
struct psi_group *group;
|
||||||
struct psi_group_cpu *groupc;
|
struct psi_group_cpu *groupc;
|
||||||
u64 now, irq;
|
u64 now;
|
||||||
s64 delta;
|
|
||||||
|
|
||||||
if (!curr->pid)
|
if (!task->pid)
|
||||||
return;
|
|
||||||
|
|
||||||
lockdep_assert_rq_held(rq);
|
|
||||||
group = task_psi_group(curr);
|
|
||||||
if (prev && task_psi_group(prev) == group)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
now = cpu_clock(cpu);
|
now = cpu_clock(cpu);
|
||||||
irq = irq_time_read(cpu);
|
|
||||||
delta = (s64)(irq - rq->psi_irq_time);
|
|
||||||
if (delta < 0)
|
|
||||||
return;
|
|
||||||
rq->psi_irq_time = irq;
|
|
||||||
|
|
||||||
|
group = task_psi_group(task);
|
||||||
do {
|
do {
|
||||||
if (!group->enabled)
|
if (!group->enabled)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1120,7 +1120,6 @@ struct rq {
|
||||||
|
|
||||||
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
||||||
u64 prev_irq_time;
|
u64 prev_irq_time;
|
||||||
u64 psi_irq_time;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PARAVIRT
|
#ifdef CONFIG_PARAVIRT
|
||||||
u64 prev_steal_time;
|
u64 prev_steal_time;
|
||||||
|
|
|
@ -110,12 +110,8 @@ __schedstats_from_se(struct sched_entity *se)
|
||||||
void psi_task_change(struct task_struct *task, int clear, int set);
|
void psi_task_change(struct task_struct *task, int clear, int set);
|
||||||
void psi_task_switch(struct task_struct *prev, struct task_struct *next,
|
void psi_task_switch(struct task_struct *prev, struct task_struct *next,
|
||||||
bool sleep);
|
bool sleep);
|
||||||
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
void psi_account_irqtime(struct task_struct *task, u32 delta);
|
||||||
void psi_account_irqtime(struct rq *rq, struct task_struct *curr, struct task_struct *prev);
|
|
||||||
#else
|
|
||||||
static inline void psi_account_irqtime(struct rq *rq, struct task_struct *curr,
|
|
||||||
struct task_struct *prev) {}
|
|
||||||
#endif /*CONFIG_IRQ_TIME_ACCOUNTING */
|
|
||||||
/*
|
/*
|
||||||
* PSI tracks state that persists across sleeps, such as iowaits and
|
* PSI tracks state that persists across sleeps, such as iowaits and
|
||||||
* memory stalls. As a result, it has to distinguish between sleeps,
|
* memory stalls. As a result, it has to distinguish between sleeps,
|
||||||
|
@ -196,8 +192,7 @@ static inline void psi_ttwu_dequeue(struct task_struct *p) {}
|
||||||
static inline void psi_sched_switch(struct task_struct *prev,
|
static inline void psi_sched_switch(struct task_struct *prev,
|
||||||
struct task_struct *next,
|
struct task_struct *next,
|
||||||
bool sleep) {}
|
bool sleep) {}
|
||||||
static inline void psi_account_irqtime(struct rq *rq, struct task_struct *curr,
|
static inline void psi_account_irqtime(struct task_struct *task, u32 delta) {}
|
||||||
struct task_struct *prev) {}
|
|
||||||
#endif /* CONFIG_PSI */
|
#endif /* CONFIG_PSI */
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_INFO
|
#ifdef CONFIG_SCHED_INFO
|
||||||
|
|
Loading…
Reference in New Issue
Block a user