lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC][PATCH] PM: disable nonboot cpus before suspending devices
    Date
    On Wednesday 03 February 2010, Andrew Morton wrote:
    > On Wed, 3 Feb 2010 02:44:23 +0100 "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
    >
    > > +static inline gfp_t clear_gfp_allowed_mask(gfp_t mask)
    > > +{
    > > + gfp_t ret = gfp_allowed_mask;
    > > + gfp_allowed_mask &= ~mask;
    > > + return ret;
    > > +}
    >
    > Fair enuf.
    >
    > Of course, this is all horridly racy/buggy without locking. Would I be
    > correct in hoping that all the callers happen when the system is in
    > everyone-is-frozen mode?

    As far as I can tell, gfp_allowed_mask is only touched during init apart from
    this.

    > Perhaps we should add some documentation (or even an assertion) to
    > prevent someone from using these interfaces from within normal code.

    I thought about that, but didn't invent anything smart enough.

    Well, maybe except for a comment like "this must be called with pm_mutex held",
    because that's the only case when it would be really safe.

    Rafael


    \
     
     \ /
      Last update: 2010-02-03 23:37    [W:0.026 / U:30.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site