Messages in this thread | | | Date | Mon, 21 Oct 2019 15:47:00 +0200 | From | Oleg Nesterov <> | Subject | Re: KCSAN: data-race in exit_signals / prepare_signal |
| |
On 10/21, Marco Elver wrote: > > On Mon, 21 Oct 2019 at 14:00, Oleg Nesterov <oleg@redhat.com> wrote: > > > > I think this is WONTFIX. > > If taking the spinlock is unnecessary (which AFAIK it probably is) and > there are no other writers to this flag, you will still need a > WRITE_ONCE(tsk->flags, tsk->flags | PF_EXITING) to avoid the > data-race.
Or even WRITE_ONCE(tsk->flags, READ_ONCE(tsk->flags) | PF_EXITING) in theory. But in practice, I do not think compiler can turn
curent->flags |= PF_EXITING;
into something which temporary clears another flag, say, PF_KTHREAD.
> However, if it is possible that there are concurrent writers setting > other bits in flags,
No, only current taks should change its ->flags.
Oleg.
| |