Re: [PATCH v2 3/6] cgroup: cgroup v2 freezer

Tejun Heo
2018-11-13T20:58:37Z

On Tue, Nov 13, 2018 at 08:55:11PM +0000, Roman Gushchin wrote:
> > > > > + if (lock_task_sighand(task, &flags)) {
> > > > > + if (test_bit(CGRP_FREEZE, &dst->flags))
> > > > > + task->jobctl |= JOBCTL_TRAP_FREEZE;
> > > > > + else
> > > > > + task->jobctl &= ~JOBCTL_TRAP_FREEZE;
> > > >
> > > > How are these flags synchronized?
> > >
> > > Using the css_set_lock.
> >
> > But other JOBCTL_TRAP bits aren't synchronized by css_set_lock, right?
>
> But if we don't touch this bit anywhere else, should be fine, right?

But other JOBCTL_TRAP_ bits aren't synchronized with css_set_lock, so
they can be updated (read-modify-write) concurrently and clobber each
other, no?

Thanks.

--
tejun