mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +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;
|
||||
delta -= irq_delta;
|
||||
psi_account_irqtime(rq->curr, irq_delta);
|
||||
#endif
|
||||
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
|
||||
if (static_key_false((¶virt_steal_rq_enabled))) {
|
||||
@@ -5678,7 +5679,7 @@ void scheduler_tick(void)
|
||||
{
|
||||
int cpu = smp_processor_id();
|
||||
struct rq *rq = cpu_rq(cpu);
|
||||
struct task_struct *curr;
|
||||
struct task_struct *curr = rq->curr;
|
||||
struct rq_flags rf;
|
||||
unsigned long thermal_pressure;
|
||||
u64 resched_latency;
|
||||
@@ -5690,9 +5691,6 @@ void scheduler_tick(void)
|
||||
|
||||
rq_lock(rq, &rf);
|
||||
|
||||
curr = rq->curr;
|
||||
psi_account_irqtime(rq, curr, NULL);
|
||||
|
||||
update_rq_clock(rq);
|
||||
trace_android_rvh_tick_entry(rq);
|
||||
|
||||
@@ -6738,7 +6736,6 @@ static void __sched notrace __schedule(unsigned int sched_mode)
|
||||
++*switch_count;
|
||||
|
||||
migrate_disable_switch(rq, prev);
|
||||
psi_account_irqtime(rq, prev, next);
|
||||
psi_sched_switch(prev, next, !task_on_rq_queued(prev));
|
||||
|
||||
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;
|
||||
u32 state_mask;
|
||||
|
||||
lockdep_assert_rq_held(cpu_rq(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
|
||||
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_cpu *groupc;
|
||||
u64 now, irq;
|
||||
s64 delta;
|
||||
u64 now;
|
||||
|
||||
if (!curr->pid)
|
||||
return;
|
||||
|
||||
lockdep_assert_rq_held(rq);
|
||||
group = task_psi_group(curr);
|
||||
if (prev && task_psi_group(prev) == group)
|
||||
if (!task->pid)
|
||||
return;
|
||||
|
||||
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 {
|
||||
if (!group->enabled)
|
||||
continue;
|
||||
|
||||
@@ -1112,7 +1112,6 @@ struct rq {
|
||||
|
||||
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
||||
u64 prev_irq_time;
|
||||
u64 psi_irq_time;
|
||||
#endif
|
||||
#ifdef CONFIG_PARAVIRT
|
||||
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_switch(struct task_struct *prev, struct task_struct *next,
|
||||
bool sleep);
|
||||
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
|
||||
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 */
|
||||
void psi_account_irqtime(struct task_struct *task, u32 delta);
|
||||
|
||||
/*
|
||||
* PSI tracks state that persists across sleeps, such as iowaits and
|
||||
* 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,
|
||||
struct task_struct *next,
|
||||
bool sleep) {}
|
||||
static inline void psi_account_irqtime(struct rq *rq, struct task_struct *curr,
|
||||
struct task_struct *prev) {}
|
||||
static inline void psi_account_irqtime(struct task_struct *task, u32 delta) {}
|
||||
#endif /* CONFIG_PSI */
|
||||
|
||||
#ifdef CONFIG_SCHED_INFO
|
||||
|
||||
Reference in New Issue
Block a user