From 83afcaa5ed67dd1c4b5e656faec0dd9f95c94bb3 Mon Sep 17 00:00:00 2001 From: Ashay Jaiswal Date: Wed, 2 Mar 2022 21:40:37 +0530 Subject: [PATCH] sched: walt: fix RCU usage warning use rcu_dereference_sched instead of rcu_dereference to fix lockdep warning generated as rcu_derefence is not used within rcu_read_lock. Change-Id: Ibd093b9e1787253b97e4efcce04cd8bd38bf88de Signed-off-by: Ashay Jaiswal --- kernel/sched/walt/walt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index 3ff5830f8def..09715994d78b 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include #include @@ -1029,7 +1030,7 @@ void fixup_busy_time(struct task_struct *p, int new_cpu) new_task = is_new_task(p); /* Protected by rq_lock */ - grp = rcu_dereference(p->wts.grp); + grp = rcu_dereference_sched(p->wts.grp); /* * For frequency aggregation, we continue to do migration fixups @@ -1972,7 +1973,7 @@ static void update_cpu_busy_time(struct task_struct *p, struct rq *rq, if (!account_busy_for_cpu_time(rq, p, irqtime, event)) goto done; - grp = rcu_dereference(p->wts.grp); + grp = rcu_dereference_sched(p->wts.grp); if (grp) { struct group_cpu_time *cpu_time = &rq->wrq.grp_time; @@ -3311,7 +3312,7 @@ static void remove_task_from_group(struct task_struct *p) int empty_group = 1; struct rq_flags rf; - grp = rcu_dereference(p->wts.grp); + grp = rcu_dereference_sched(p->wts.grp); raw_spin_lock(&grp->lock); rq = __task_rq_lock(p, &rf);