walt_lb: Read push_task under lock

push_task assignment is guarded by corresponding runqueue's lock. Read
it only when lock is acquired.

Change-Id: I74668df66b4e18286b919b136d912a3f8afda11c
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
This commit is contained in:
Elliot Berman 2021-11-02 09:30:31 -07:00 committed by Rishabh Bhatnagar
parent 2eecd3353f
commit 3fbfc998c9

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <trace/hooks/sched.h>
@ -39,10 +40,11 @@ static int walt_lb_active_migration(void *data)
int target_cpu = busiest_rq->push_cpu;
struct rq *target_rq = cpu_rq(target_cpu);
struct walt_rq *wrq = (struct walt_rq *) busiest_rq->android_vendor_data1;
struct task_struct *push_task = wrq->push_task;
struct task_struct *push_task;
int push_task_detached = 0;
raw_spin_lock_irq(&busiest_rq->__lock);
push_task = wrq->push_task;
/* sanity checks before initiating the pull */
if (!cpu_active(busiest_cpu) || !cpu_active(target_cpu) || !push_task)