[linux-pm] [Suspend-devel] [RFC][PATCH -mm 1/5] PM: Make freeze_processes SMP-safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/26/06, Pavel Machek <pavel at ucw.cz> wrote:
===================================================================
> > --- linux-2.6.19-rc6-mm1.orig/include/linux/sched.h
> > +++ linux-2.6.19-rc6-mm1/include/linux/sched.h
> > @@ -1065,6 +1065,9 @@ struct task_struct {
> >  #ifdef       CONFIG_TASK_DELAY_ACCT
> >       struct task_delay_info *delays;
> >  #endif
> > +#ifdef CONFIG_PM
> > +     int freezing;           /* if set, we should be freezing for suspend */
> > +#endif
> >  #ifdef CONFIG_FAULT_INJECTION
> >       int make_it_fail;
> >  #endif
>
> It is int, imagine machine that can't do 32-bit atomic access (only
> does 64 bits). On such beast (alpha? something stranger?) this will
> clobber make_it_fail field, sometimes.
>
> OTOH on i386 normal instructions can be used. But that's okay, we
> should just use atomic_t here. Should be as fast on i386/x86-64, and
> still safe.

What about using lock_task_sighand()? This should protect us against
->flags manipulation due to signals without the need of an extra
field.

Luca


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux