mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
sched/walt: Change task state variable
Upstream changed task's state variable in struct task_struct to non-volatile. Reflect these changes downstream. Change-Id: Icc9736e6b5f6fb5b7d02fde6d3117a9131d98b50 Signed-off-by: Sai Harshini Nimmala <snimmala@codeaurora.org>
This commit is contained in:
parent
822a7c683b
commit
03ee181e27
|
|
@ -184,7 +184,7 @@ void walt_task_dump(struct task_struct *p)
|
|||
bool is_32bit_thread = is_compat_thread(task_thread_info(p));
|
||||
|
||||
printk_deferred("Task: %.16s-%d\n", p->comm, p->pid);
|
||||
SCHED_PRINT(p->state);
|
||||
SCHED_PRINT(READ_ONCE(p->__state));
|
||||
SCHED_PRINT(p->cpu);
|
||||
SCHED_PRINT(p->policy);
|
||||
SCHED_PRINT(p->prio);
|
||||
|
|
@ -580,7 +580,7 @@ static inline u64 freq_policy_load(struct rq *rq)
|
|||
load = wrq->prev_runnable_sum +
|
||||
wrq->grp_time.prev_runnable_sum;
|
||||
|
||||
if (cpu_ksoftirqd && cpu_ksoftirqd->state == TASK_RUNNING)
|
||||
if (cpu_ksoftirqd && READ_ONCE(cpu_ksoftirqd->__state) == TASK_RUNNING)
|
||||
load = max_t(u64, load, task_load(cpu_ksoftirqd));
|
||||
|
||||
tt_load = top_task_load(rq);
|
||||
|
|
@ -967,10 +967,10 @@ static void fixup_busy_time(struct task_struct *p, int new_cpu)
|
|||
struct walt_rq *src_wrq = (struct walt_rq *) src_rq->android_vendor_data1;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
|
||||
if (!p->on_rq && p->state != TASK_WAKING)
|
||||
if (!p->on_rq && READ_ONCE(p->__state) != TASK_WAKING)
|
||||
return;
|
||||
|
||||
pstate = p->state;
|
||||
pstate = READ_ONCE(p->__state);
|
||||
|
||||
if (pstate == TASK_WAKING)
|
||||
double_rq_lock(src_rq, dest_rq);
|
||||
|
|
@ -2181,7 +2181,7 @@ static void walt_update_task_ravg(struct task_struct *p, struct rq *rq, int even
|
|||
update_task_demand(p, rq, event, wallclock);
|
||||
update_cpu_busy_time(p, rq, event, wallclock, irqtime);
|
||||
update_task_pred_demand(rq, p, event);
|
||||
if (event == PUT_PREV_TASK && p->state)
|
||||
if (event == PUT_PREV_TASK && READ_ONCE(p->__state))
|
||||
wts->iowaited = p->in_iowait;
|
||||
|
||||
trace_sched_update_task_ravg(p, rq, event, wallclock, irqtime,
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ static unsigned long cpu_util_without(int cpu, struct task_struct *p)
|
|||
* utilization from cpu utilization. Instead just use
|
||||
* cpu_util for this case.
|
||||
*/
|
||||
if (likely(p->state == TASK_WAKING))
|
||||
if (likely(READ_ONCE(p->__state) == TASK_WAKING))
|
||||
return cpu_util(cpu);
|
||||
|
||||
/* Task has no contribution or is new */
|
||||
|
|
@ -835,7 +835,7 @@ int walt_find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
|
|||
goto unlock;
|
||||
}
|
||||
|
||||
if (p->state == TASK_WAKING)
|
||||
if (READ_ONCE(p->__state) == TASK_WAKING)
|
||||
delta = task_util(p);
|
||||
|
||||
if (cpumask_test_cpu(prev_cpu, &p->cpus_mask) && !__cpu_overutilized(prev_cpu, delta)) {
|
||||
|
|
@ -1172,7 +1172,7 @@ void walt_cfs_dequeue_task(struct rq *rq, struct task_struct *p)
|
|||
* be preserved when task is enq/deq while it is on
|
||||
* runqueue.
|
||||
*/
|
||||
if (p->state != TASK_RUNNING)
|
||||
if (READ_ONCE(p->__state) != TASK_RUNNING)
|
||||
wts->total_exec = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ static int walt_lb_active_migration(void *data)
|
|||
BUG_ON(busiest_rq == target_rq);
|
||||
|
||||
if (task_on_rq_queued(push_task) &&
|
||||
push_task->state == TASK_RUNNING &&
|
||||
READ_ONCE(push_task->__state) == TASK_RUNNING &&
|
||||
task_cpu(push_task) == busiest_cpu &&
|
||||
cpu_active(target_cpu) &&
|
||||
cpumask_test_cpu(target_cpu, push_task->cpus_ptr)) {
|
||||
|
|
@ -506,7 +506,7 @@ void walt_lb_tick(struct rq *rq)
|
|||
if (!rq->misfit_task_load)
|
||||
return;
|
||||
|
||||
if (p->state != TASK_RUNNING || p->nr_cpus_allowed == 1)
|
||||
if (READ_ONCE(p->__state) != TASK_RUNNING || p->nr_cpus_allowed == 1)
|
||||
return;
|
||||
|
||||
raw_spin_lock_irqsave(&walt_lb_migration_lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user