public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>,
	Ondrej Zary <linux@rainbow-software.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Balbir Singh <balbir@in.ibm.com>
Subject: Re: 2.6.35.5: hibernation broken... AGAIN
Date: Wed, 1 Dec 2010 22:25:40 +0100	[thread overview]
Message-ID: <201012012225.40329.rjw@sisk.pl> (raw)
In-Reply-To: <20101201095349.c1f3ac46.kamezawa.hiroyu@jp.fujitsu.com>

On Wednesday, December 01, 2010, KAMEZAWA Hiroyuki wrote:
> 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 ?

What exactly would that be useful for?

Rafael

  reply	other threads:[~2010-12-01 21:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 10:39 2.6.35.5: hibernation broken... AGAIN Ondrej Zary
2010-11-17 20:53 ` Rafael J. Wysocki
2010-11-17 21:04   ` Andrew Morton
2010-11-17 21:12     ` Rafael J. Wysocki
2010-11-17 21:18       ` Ondrej Zary
2010-11-17 23:46         ` Hugh Dickins
2010-11-20 15:07           ` Ondrej Zary
2010-11-26 11:43           ` Ondrej Zary
2010-11-26 23:10             ` Rafael J. Wysocki
2010-11-27 14:58               ` Ondrej Zary
2010-11-27 20:47                 ` Rafael J. Wysocki
2010-11-30 22:16                   ` Hugh Dickins
2010-11-30 23:07                     ` Rafael J. Wysocki
2010-12-01  0:38                       ` Rafael J. Wysocki
2010-12-01  0:53                         ` KAMEZAWA Hiroyuki
2010-12-01 21:25                           ` Rafael J. Wysocki [this message]
2010-12-01 22:23                             ` Rafael J. Wysocki
2010-12-01 23:37                               ` KAMEZAWA Hiroyuki
2010-12-02  0:00                                 ` Rafael J. Wysocki
2010-12-01  1:21                         ` Hugh Dickins
2010-12-01 20:57                           ` Rafael J. Wysocki
2010-12-06 21:09                   ` Ondrej Zary
2010-12-06 22:57                     ` Rafael J. Wysocki
2010-11-26 20:24           ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012012225.40329.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@in.ibm.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox