[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YA/ezfU+/2ggZKTy@hirez.programming.kicks-ass.net>
Date: Tue, 26 Jan 2021 10:20:13 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: qiang.zhang@...driver.com
Cc: valentin.schneider@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/core: add rcu_read_lock/unlock() protection
On Tue, Jan 26, 2021 at 04:46:51PM +0800, qiang.zhang@...driver.com wrote:
> From: Zqiang <qiang.zhang@...driver.com>
>
> Due to for_each_process_thread belongs to RCU read operation,
> need to add rcu_read_lock/unlock() protection.
>
> Signed-off-by: Zqiang <qiang.zhang@...driver.com>
> ---
> kernel/sched/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 8c5481077c9c..c3f0103fdf53 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7738,6 +7738,7 @@ static void dump_rq_tasks(struct rq *rq, const char *loglvl)
> lockdep_assert_held(&rq->lock);
>
> printk("%sCPU%d enqueued tasks (%u total):\n", loglvl, cpu, rq->nr_running);
> + rcu_read_lock();
> for_each_process_thread(g, p) {
> if (task_cpu(p) != cpu)
> continue;
> @@ -7747,6 +7748,7 @@ static void dump_rq_tasks(struct rq *rq, const char *loglvl)
>
> printk("%s\tpid: %d, name: %s\n", loglvl, p->pid, p->comm);
> }
> + rcu_read_unlock();
We're in stop machine, with IRQs disabled, please explain how this can
make any difference?
Powered by blists - more mailing lists