mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Revert "sched: Move psi_account_irqtime() out of update_rq_clock_task() hotpath"
This reverts commit bfaf0990f1 which is
commit ddae0ca2a8fe12d0e24ab10ba759c3fbd755ada8 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: I8853ca9becfb9c32a846a41d5866dc4070a15b90
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -721,6 +721,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);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
|
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
|
||||||
if (static_key_false((¶virt_steal_rq_enabled))) {
|
if (static_key_false((¶virt_steal_rq_enabled))) {
|
||||||
@@ -5678,7 +5679,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;
|
||||||
@@ -5690,9 +5691,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);
|
||||||
|
|
||||||
@@ -6738,7 +6736,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);
|
||||||
|
|||||||
@@ -737,7 +737,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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -956,29 +955,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;
|
||||||
|
|||||||
@@ -1112,7 +1112,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,
|
||||||
@@ -210,8 +206,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
|
||||||
|
|||||||
Reference in New Issue
Block a user