Re: cgroup_enable_task_cg_lists && PF_EXITING (Was: KCSAN: data-race in exit_signals / prepare_signal)

From: Tejun Heo
Date: Thu Oct 24 2019 - 13:54:32 EST


Hello, Oleg.

On Mon, Oct 21, 2019 at 04:21:11PM +0200, Oleg Nesterov wrote:
> could you explain the usage of siglock/PF_EXITING in
> cgroup_enable_task_cg_lists() ?
>
> PF_EXITING is protected by cgroup_threadgroup_rwsem, not by
> sighand->siglock.

Yeah, the optimization was added a really long time ago and I'm not
sure it was ever correct. I'm removing it. If this ever becomes a
problem (pretty unlikely), I think the right thing to do is adding a
boot param instead of trying to do this dynamically.

Thanks.

--
tejun