[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240117123133.2e40438936167e6a4aec8b16@linux-foundation.org>
Date: Wed, 17 Jan 2024 12:31:33 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Chen Zhongjin <chenzhongjin@...wei.com>
Cc: <linux-kernel@...r.kernel.org>, <linux-trace-kernel@...r.kernel.org>,
<yangjihong1@...wei.com>, <naveen.n.rao@...ux.ibm.com>,
<anil.s.keshavamurthy@...el.com>, <davem@...emloft.net>,
<paulmck@...nel.org>, <mhiramat@...nel.org>, <tglx@...utronix.de>,
<peterz@...radead.org>, <pmladek@...e.com>, <dianders@...omium.org>,
<npiggin@...il.com>, <mpe@...erman.id.au>, <jkl820.git@...il.com>,
<juerg.haefliger@...onical.com>, <rick.p.edgecombe@...el.com>,
<eric.devolder@...cle.com>, <mic@...ikod.net>
Subject: Re: [PATCH] kprobes: Use synchronize_rcu_tasks_rude in
kprobe_optimizer
On Wed, 17 Jan 2024 06:16:36 +0000 Chen Zhongjin <chenzhongjin@...wei.com> wrote:
> There is a deadlock scenario in kprobe_optimizer():
>
> pid A pid B pid C
> kprobe_optimizer() do_exit() perf_kprobe_init()
> mutex_lock(&kprobe_mutex) exit_tasks_rcu_start() mutex_lock(&kprobe_mutex)
> synchronize_rcu_tasks() zap_pid_ns_processes() // waiting kprobe_mutex
> // waiting tasks_rcu_exit_srcu kernel_wait4()
> // waiting pid C exit
>
> To avoid this deadlock loop, use synchronize_rcu_tasks_rude() in kprobe_optimizer()
> rather than synchronize_rcu_tasks(). synchronize_rcu_tasks_rude() can also promise
> that all preempted tasks have scheduled, but it will not wait tasks_rcu_exit_srcu.
>
> Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
Thanks. Should we backport this fix into earlier kernels? If so, are
we able to identify a suitable Fixes: target?
Powered by blists - more mailing lists