lkml.org 
[lkml]   [2010]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: 2.6.35.5: hibernation broken... AGAIN
    On Wed, 1 Dec 2010 01:38:53 +0100
    "Rafael J. Wysocki" <rjw@sisk.pl> wrote:

    > On Wednesday, December 01, 2010, Rafael J. Wysocki wrote:
    > > On Tuesday, November 30, 2010, Hugh Dickins wrote:
    > > > On Sat, 27 Nov 2010, Rafael J. Wysocki wrote:
    > > > > On Saturday, November 27, 2010, Ondrej Zary wrote:
    > ...
    > > >
    > > > Trivial point, I suppose, but it bothers me that PM is accumulating
    > > > wrappers around wrappers around gfp_allowed_mask. Looks like
    > > > clear_gfp_allowed_mask and set_gfp_allowed_mask (oddly asymmetrical)
    > > > were not really what we need. How about scrapping them, and putting
    > > > pm_restrict_gfp_mask() and pm_restore_gfp_mask() into page_alloc.c?
    > >
    > > Sure, that sounds like a good idea indeed.
    >
    > Below is an updated patch in which I tried to address your comments.
    >
    > I didn't find it very useful to couple pm_restore_gfp_mask() with the thawing
    > of tasks, but nevertheless I think all of the spots where it's needed are
    > covered now.
    >
    > The patch has only been compile-tested for now, so caveat emptor.
    >

    Hmm, can't we have some error check as

    > +static gfp_t saved_gfp_mask;

    atomic_t gfp_mask_save_mode_counter;

    > +
    > +void pm_restore_gfp_mask(void)
    > {
    > WARN_ON(!mutex_is_locked(&pm_mutex));
    > - gfp_allowed_mask = mask;

    if (atomic_dec_return(&gfp_mask_save_mode_counter))
    WARN_ONCE()

    > + if (saved_gfp_mask) {
    > + gfp_allowed_mask = saved_gfp_mask;
    > + saved_gfp_mask = 0;
    > + }
    > }

    > +void pm_restrict_gfp_mask(void)
    > {
    > - gfp_t ret = gfp_allowed_mask;
    > -
    > WARN_ON(!mutex_is_locked(&pm_mutex));
    > - gfp_allowed_mask &= ~mask;
    > - return ret;
    > + saved_gfp_mask = gfp_allowed_mask;
    > + gfp_allowed_mask &= ~GFP_IOFS;

    if (atomic_inc_return(&gfp_mask_save_mode_counter) > 1)
    WARN_ONCE()

    or some ?

    Thanks,
    -Kame



    \
     
     \ /
      Last update: 2010-12-01 02:01    [W:3.978 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site