public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: David Rientjes <rientjes@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alan-jenkins@tuffmail.co.uk" <alan-jenkins@tuffmail.co.uk>,
	"jens.axboe@oracle.com" <jens.axboe@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"kernel-testers@vger.kernel.org" <kernel-testers@vger.kernel.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"linux-pm@lists.linux-foundation.org"
	<linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH 1/5] mm: Add __GFP_NO_OOM_KILL flag
Date: Sat, 9 May 2009 02:08:43 +0200	[thread overview]
Message-ID: <200905090208.44381.rjw@sisk.pl> (raw)
In-Reply-To: <200905081551.56577.rjw@sisk.pl>

On Friday 08 May 2009, Rafael J. Wysocki wrote:
> On Friday 08 May 2009, Wu Fengguang wrote:
[--snip--]
> > But hey, that 'count' counts "savable+free" memory.
> > We don't have a counter for an estimation of "free+freeable" memory,
> > ie. we are sure we cannot preallocate above that threshold. 
> > 
> > One applicable situation is, when there are 800M anonymous memory,
> > but only 500M image_size and no swap space.
> > 
> > In that case we will otherwise goto the oom code path. Sure oom is
> > (and shall be) reliably disabled in hibernation, but still we shall be
> > cautious enough not to create a low memory situation, which will hurt:
> > - hibernation speed
> >   (vmscan goes mad trying to squeeze the last free page)
> > - user experiences after resume
> >   (all *active* file data and metadata have to reloaded)
> 
> Strangely enough, my recent testing with this patch doesn't confirm the
> theory. :-)  Namely, I set image_size too low on purpose and it only caused
> preallocate_image_memory() to return NULL at one point and that was it.
> 
> It didn't even took too much time.
> 
> I'll carry out more testing to verify this observation.

I can confirm that even if image_size is below the minimum we can get,
the second preallocate_image_memory() just returns after allocating fewer pages
that it's been asked for (that's with the original __GFP_NO_OOM_KILL-based
approach, as I wrote in the previous message in this thread) and nothing bad
happens.

That may be because we freeze the mm kernel threads, but I've also tested
without freezing them and it's still worked the same way.

> > The current code simply tries *too hard* to meet image_size.
> > I'd rather take that as a mild advice, and to only free
> > "free+freeable-margin" pages when image_size is not approachable.
> > 
> > The safety margin can be totalreserve_pages, plus enough pages for
> > retaining the "hard core working set".
> 
> How to compute the size of the "hard core working set", then?

Well, I'm still interested in the answer here. ;-)

Best,
Rafael

  parent reply	other threads:[~2009-05-09  0:08 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <nY3-4PrO6XH.A.xtB.yw85JB@chimera>
     [not found] ` <200904222211.18221.rjw@sisk.pl>
     [not found]   ` <20090422131943.69288af3.akpm@linux-foundation.org>
2009-05-01 22:26     ` [PATCH 0/3] PM: Drop shrink_all_memory (was: Re: [Bug #13058] First hibernation attempt fails) Rafael J. Wysocki
     [not found]     ` <200905020026.19027.rjw@sisk.pl>
2009-05-01 22:27       ` [PATCH 1/3] PM: Disable OOM killer during system-wide power transitions Rafael J. Wysocki
2009-05-01 22:28       ` [PATCH 2/3] PM/Hibernate: Move memory shrinking to snapshot.c Rafael J. Wysocki
2009-05-01 22:29       ` [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory Rafael J. Wysocki
     [not found]       ` <200905020027.31244.rjw@sisk.pl>
2009-05-01 23:09         ` [PATCH 1/3] PM: Disable OOM killer during system-wide power transitions Andrew Morton
     [not found]         ` <20090501160931.1dbd2abc.akpm@linux-foundation.org>
2009-05-02 11:34           ` Rafael J. Wysocki
     [not found]           ` <200905021334.51261.rjw@sisk.pl>
2009-05-03  9:47             ` Pavel Machek
     [not found]       ` <200905020029.39181.rjw@sisk.pl>
2009-05-01 23:14         ` [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory Andrew Morton
     [not found]         ` <20090501161423.94b37d5b.akpm@linux-foundation.org>
2009-05-02 11:46           ` Rafael J. Wysocki
     [not found]           ` <200905021346.34967.rjw@sisk.pl>
2009-05-02 17:49             ` Andrew Morton
     [not found]             ` <20090502104947.2720f173.akpm@linux-foundation.org>
2009-05-03  0:20               ` [PATCH 0/4] PM: Drop shrink_all_memory (rev. 2) (was: Re: [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory) Rafael J. Wysocki
     [not found]               ` <200905030220.57933.rjw@sisk.pl>
2009-05-03  0:22                 ` [PATCH 1/4] mm: Add __GFP_NO_OOM_KILL flag Rafael J. Wysocki
2009-05-03  0:23                 ` [PATCH 2/4] PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2) Rafael J. Wysocki
2009-05-03  0:24                 ` [PATCH 3/4] PM/Hibernate: Use memory allocations to free memory " Rafael J. Wysocki
2009-05-03  0:25                 ` [PATCH 4/4] PM/Hibernate: Do not release preallocated memory unnecessarily Rafael J. Wysocki
     [not found]                 ` <200905030224.21471.rjw@sisk.pl>
2009-05-03  3:06                   ` [PATCH 3/4] PM/Hibernate: Use memory allocations to free memory (rev. 2) Linus Torvalds
2009-05-03 11:51                   ` Wu Fengguang
     [not found]                   ` <alpine.LFD.2.01.0905021958480.4983@localhost.localdomain>
2009-05-03  9:36                     ` Pavel Machek
2009-05-03 16:15                     ` Rafael J. Wysocki
     [not found]                     ` <20090503093659.GA10278@elf.ucw.cz>
2009-05-03 16:35                       ` Rafael J. Wysocki
     [not found]                       ` <200905031835.06928.rjw@sisk.pl>
2009-05-04  9:36                         ` Pavel Machek
     [not found]                   ` <20090503115127.GA9661@localhost>
2009-05-03 16:22                     ` Rafael J. Wysocki
     [not found]                     ` <200905031822.55260.rjw@sisk.pl>
2009-05-04  9:31                       ` Pavel Machek
     [not found]                       ` <20090504093121.GB30306@elf.ucw.cz>
2009-05-04 19:52                         ` Rafael J. Wysocki
     [not found]                 ` <200905030222.07360.rjw@sisk.pl>
2009-05-03 11:54                   ` [PATCH 1/4] mm: Add __GFP_NO_OOM_KILL flag Wu Fengguang
2009-05-03 13:08                 ` [PATCH 0/4] PM: Drop shrink_all_memory (rev. 2) (was: Re: [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory) Wu Fengguang
     [not found]                 ` <20090503130818.GC9661@localhost>
2009-05-03 16:30                   ` Rafael J. Wysocki
     [not found]                   ` <200905031830.49690.rjw@sisk.pl>
2009-05-04  0:08                     ` [PATCH 0/5] PM: Drop shrink_all_memory (rev. 3) Rafael J. Wysocki
     [not found]                     ` <200905040208.43040.rjw@sisk.pl>
2009-05-04  0:10                       ` [PATCH 1/5] mm: Add __GFP_NO_OOM_KILL flag Rafael J. Wysocki
2009-05-04  0:11                       ` [PATCH 2/5] PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2) Rafael J. Wysocki
2009-05-04  0:12                       ` [PATCH 3/5] PM/Suspend: Do not shrink memory before suspend Rafael J. Wysocki
2009-05-04  0:20                       ` [PATCH 4/5] PM/Hibernate: Use memory allocations to free memory (rev. 3) Rafael J. Wysocki
2009-05-04  0:22                       ` [PATCH 5/5] PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2) Rafael J. Wysocki
     [not found]                       ` <200905040210.10153.rjw@sisk.pl>
2009-05-04  0:38                         ` [PATCH 1/5] mm: Add __GFP_NO_OOM_KILL flag David Rientjes
     [not found]                         ` <alpine.DEB.2.00.0905031734190.24114@chino.kir.corp.google.com>
2009-05-04 15:02                           ` Rafael J. Wysocki
     [not found]                           ` <200905041702.23291.rjw@sisk.pl>
2009-05-04 16:44                             ` David Rientjes
2009-05-04 19:01                             ` Andrew Morton
     [not found]                             ` <alpine.DEB.2.00.0905040939400.10707@chino.kir.corp.google.com>
2009-05-04 19:51                               ` Rafael J. Wysocki
     [not found]                               ` <200905042151.07953.rjw@sisk.pl>
2009-05-04 20:02                                 ` David Rientjes
     [not found]                                 ` <alpine.DEB.2.00.0905041253380.23036@chino.kir.corp.google.com>
2009-05-04 22:23                                   ` Rafael J. Wysocki
     [not found]                                   ` <200905050023.38064.rjw@sisk.pl>
2009-05-05  0:37                                     ` David Rientjes
     [not found]                                     ` <alpine.DEB.2.00.0905041735590.24101@chino.kir.corp.google.com>
2009-05-05 22:19                                       ` Rafael J. Wysocki
     [not found]                                       ` <200905060019.36542.rjw@sisk.pl>
2009-05-05 22:37                                         ` Andrew Morton
     [not found]                                         ` <20090505153739.2cc9d244.akpm@linux-foundation.org>
2009-05-05 23:20                                           ` Rafael J. Wysocki
     [not found]                                           ` <200905060120.35698.rjw@sisk.pl>
2009-05-05 23:40                                             ` Andrew Morton
     [not found]                                             ` <20090505164028.e9d807a1.akpm@linux-foundation.org>
2009-05-07 18:09                                               ` Rafael J. Wysocki
     [not found]                                               ` <200905072009.53406.rjw@sisk.pl>
2009-05-07 18:48                                                 ` Andrew Morton
2009-05-07 18:50                                                 ` David Rientjes
     [not found]                                                 ` <20090507114807.d7c6d26a.akpm@linux-foundation.org>
2009-05-07 19:33                                                   ` Rafael J. Wysocki
     [not found]                                                   ` <200905072133.48917.rjw@sisk.pl>
2009-05-07 20:02                                                     ` Andrew Morton
     [not found]                                                     ` <20090507130202.34cbe37a.akpm@linux-foundation.org>
2009-05-07 20:18                                                       ` Rafael J. Wysocki
     [not found]                                                       ` <200905072218.50782.rjw@sisk.pl>
2009-05-07 20:25                                                         ` David Rientjes
     [not found]                                                         ` <alpine.DEB.2.00.0905071321440.646@chino.kir.corp.google.com>
2009-05-07 20:35                                                           ` Pavel Machek
2009-05-07 20:38                                                           ` Rafael J. Wysocki
     [not found]                                                           ` <20090507203518.GA1652@ucw.cz>
2009-05-07 20:40                                                             ` David Rientjes
     [not found]                                                           ` <200905072238.14558.rjw@sisk.pl>
2009-05-07 20:42                                                             ` David Rientjes
2009-05-07 20:56                                                             ` Andrew Morton
     [not found]                                                             ` <20090507135615.e7db550d.akpm@linux-foundation.org>
2009-05-07 21:25                                                               ` David Rientjes
     [not found]                                                               ` <alpine.DEB.2.00.0905071417160.24417@chino.kir.corp.google.com>
2009-05-07 21:36                                                                 ` Rafael J. Wysocki
     [not found]                                                                 ` <200905072336.11383.rjw@sisk.pl>
2009-05-07 21:46                                                                   ` David Rientjes
     [not found]                                                                   ` <alpine.DEB.2.00.0905071439370.24404@chino.kir.corp.google.com>
2009-05-07 22:05                                                                     ` Rafael J. Wysocki
2009-05-07 21:50                                                                 ` Andrew Morton
     [not found]                                                                 ` <20090507145041.9b59f4eb.akpm@linux-foundation.org>
2009-05-07 22:14                                                                   ` Rafael J. Wysocki
2009-05-07 22:16                                                                   ` David Rientjes
     [not found]                                                                   ` <200905080014.49426.rjw@sisk.pl>
2009-05-07 22:38                                                                     ` Andrew Morton
     [not found]                                                                     ` <20090507153824.df54658c.akpm@linux-foundation.org>
2009-05-07 22:50                                                                       ` Rafael J. Wysocki
     [not found]                                                                       ` <200905080050.41973.rjw@sisk.pl>
2009-05-07 23:15                                                                         ` Andrew Morton
     [not found]                                                                         ` <20090507161508.42f586ef.akpm@linux-foundation.org>
2009-05-07 23:24                                                                           ` Rafael J. Wysocki
     [not found]                                                                   ` <alpine.DEB.2.00.0905071508190.2164@chino.kir.corp.google.com>
2009-05-07 22:45                                                                     ` Andrew Morton
     [not found]                                                                     ` <20090507154502.a7f51dd9.akpm@linux-foundation.org>
2009-05-07 22:59                                                                       ` David Rientjes
     [not found]                                                                       ` <alpine.DEB.2.00.0905071554490.10759@chino.kir.corp.google.com>
2009-05-07 23:11                                                                         ` Rafael J. Wysocki
     [not found]                                                                         ` <200905080111.31273.rjw@sisk.pl>
2009-05-08  1:16                                                                           ` KAMEZAWA Hiroyuki
2009-05-08  9:50                                                                           ` Wu Fengguang
     [not found]                                                                           ` <20090508101651.aa4d513d.kamezawa.hiroyu@jp.fujitsu.com>
2009-05-08 13:42                                                                             ` Rafael J. Wysocki
     [not found]                                                                           ` <20090508095010.GA26398@localhost>
2009-05-08 13:51                                                                             ` Rafael J. Wysocki
     [not found]                                                                             ` <200905081551.56577.rjw@sisk.pl>
2009-05-09  0:08                                                                               ` Rafael J. Wysocki [this message]
2009-05-09  7:34                                                                                 ` Wu Fengguang
     [not found]                                                                                 ` <20090509073417.GB6487@localhost>
2009-05-09 19:22                                                                                   ` Rafael J. Wysocki
     [not found]                                                                                   ` <200905092122.58640.rjw@sisk.pl>
2009-05-10  4:52                                                                                     ` Wu Fengguang
     [not found]                                                                                     ` <20090510045216.GA5794@localhost>
2009-05-10 12:52                                                                                       ` Rafael J. Wysocki
2009-05-08 23:55                                                           ` Rafael J. Wysocki
     [not found]                                                           ` <200905090155.44635.rjw@sisk.pl>
2009-05-09 21:22                                                             ` David Rientjes
     [not found]                                                             ` <alpine.DEB.2.00.0905091415310.1124@chino.kir.corp.google.com>
2009-05-09 21:37                                                               ` Rafael J. Wysocki
     [not found]                                                               ` <200905092337.39906.rjw@sisk.pl>
2009-05-09 22:39                                                                 ` David Rientjes
     [not found]                                                                 ` <alpine.DEB.2.00.0905091536250.6272@chino.kir.corp.google.com>
2009-05-09 23:03                                                                   ` Rafael J. Wysocki
     [not found]                                                                   ` <200905100103.23815.rjw@sisk.pl>
2009-05-11 20:11                                                                     ` David Rientjes
     [not found]                                                                     ` <alpine.DEB.2.00.0905111249170.23739@chino.kir.corp.google.com>
2009-05-11 22:44                                                                       ` Rafael J. Wysocki
     [not found]                                                                       ` <200905120044.37342.rjw@sisk.pl>
2009-05-11 23:07                                                                         ` Andrew Morton
     [not found]                                                                         ` <20090511160704.e1fa2512.akpm@linux-foundation.org>
2009-05-11 23:28                                                                           ` Rafael J. Wysocki
     [not found]                                                                           ` <200905120128.16780.rjw@sisk.pl>
2009-05-12  0:11                                                                             ` Andrew Morton
     [not found]                                                                             ` <20090511171111.9d74e4c0.akpm@linux-foundation.org>
2009-05-12 16:52                                                                               ` Rafael J. Wysocki
     [not found]                                                                               ` <200905121852.37224.rjw@sisk.pl>
2009-05-12 17:50                                                                                 ` Andrew Morton
2009-05-12 20:40                                                                                   ` Rafael J. Wysocki
     [not found]                       ` <200905040211.03569.rjw@sisk.pl>
2009-05-04 13:35                         ` [PATCH 2/5] PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2) Pavel Machek
     [not found]                       ` <200905040222.39062.rjw@sisk.pl>
2009-05-05  2:24                         ` [PATCH 5/5] PM/Hibernate: Do not release preallocated memory unnecessarily " Wu Fengguang
     [not found]                         ` <20090505022427.GA10880@localhost>
2009-05-05  2:46                           ` Wu Fengguang
2009-05-05 23:05                           ` Rafael J. Wysocki
     [not found]                           ` <20090505024646.GA14621@localhost>
2009-05-05 23:07                             ` Rafael J. Wysocki
     [not found]                             ` <200905060107.45345.rjw@sisk.pl>
2009-05-05 23:40                               ` Wu Fengguang
     [not found]                           ` <200905060105.10800.rjw@sisk.pl>
2009-05-06 13:30                             ` Wu Fengguang
2009-05-06 13:52                             ` Wu Fengguang
2009-05-06 13:56                             ` Wu Fengguang
     [not found]                             ` <20090506135659.GB26233@localhost>
2009-05-06 20:54                               ` Rafael J. Wysocki
     [not found]                               ` <200905062254.10227.rjw@sisk.pl>
2009-05-07  1:58                                 ` Wu Fengguang
     [not found]                                 ` <20090507015803.GA12281@localhost>
2009-05-07 12:20                                   ` Rafael J. Wysocki
     [not found]                                   ` <200905071420.43491.rjw@sisk.pl>
2009-05-07 12:34                                     ` Wu Fengguang
2009-08-16 13:46                             ` Wu Fengguang
     [not found]                             ` <20090816134610.GA6266@localhost>
2009-08-16 22:48                               ` Rafael J. Wysocki
2009-05-04  9:33                     ` [PATCH 0/4] PM: Drop shrink_all_memory (rev. 2) (was: Re: [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory) Pavel Machek
     [not found]                     ` <20090504093310.GC30306@elf.ucw.cz>
2009-05-04 19:53                       ` Rafael J. Wysocki
     [not found]                       ` <200905042153.37069.rjw@sisk.pl>
2009-05-04 20:27                         ` Pavel Machek

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=200905090208.44381.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=alan-jenkins@tuffmail.co.uk \
    --cc=fengguang.wu@intel.com \
    --cc=jens.axboe@oracle.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rientjes@google.com \
    --cc=torvalds@linux-foundation.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