On 12/03/20(Thu) 14:30, Claudio Jeker wrote:
> On Thu, Mar 12, 2020 at 08:15:00AM -0500, Amit Kulkarni wrote:
> > Hi,
> > 
> > In grepping for ps_flags in /sys, it is confusing to see that ps_flags is 
> > associated with
> > 
> > 1) PWM_POLARITY (power regulation?).
> >     Proposed to rename to ps_pwmflags?
> > 2) process signals: struct sigacts in /sys/sys/signalvar.h
> > 3) its rightful usage as ps_flags for struct process in /sys/sys/proc.h
> > 
> > 
> > So, to reduce confusion while grepping, the below diff simply renames 
> > usages of ps_flags in relation to struct sigacts (#2 above) to ps_sigflags.
> > 
> 
> I have the same issue with ps_flags vs ps_flags and I think it resulted in
> some major confusion for others as well. See inline.

I agree this would make grep/looking at code easier :o)

> > @@ -336,9 +336,9 @@ setsigvec(struct proc *p, int signum, st
> >     ps->ps_catchmask[signum] = sa->sa_mask &~ sigcantmask;
> >     if (signum == SIGCHLD) {
> >             if (sa->sa_flags & SA_NOCLDSTOP)
> > -                   atomic_setbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
> > +                   atomic_setbits_int(&ps->ps_sigflags, SAS_NOCLDSTOP);
> >             else
> > -                   atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
> > +                   atomic_clearbits_int(&ps->ps_sigflags, SAS_NOCLDSTOP);
> 
> I doubt these should be atomic functions here. The sigacts ps_flags are
> don't need atomic updates (especially since most other calls are not
> atomic.

Indeed, this is a leftover from the introduction of P_SIGSUSPEND.
Before that per-thread flags where used and needed atomic operations.

That said we can rename it then remove the atomic operations :)

ok mpi@

Reply via email to