On Thu, 2009-05-07 at 14:18 +0200, Rafael J. Wysocki wrote:> On Thursday 07 May 2009, Nigel Cunningham wrote:> > Hi.> > Hi,> > > On Thu, 2009-05-07 at 00:44 +0200, Rafael J. Wysocki wrote:> > > From: Rafael J. Wysocki <rjw@sisk.pl>> > > > > > Rework swsusp_shrink_memory() so that it calls shrink_all_memory()> > > just once to make some room for the image and then allocates memory> > > to apply more pressure to the memory management subsystem, if> > > necessary.> > > > > > Unfortunately, we don't seem to be able to drop shrink_all_memory()> > > entirely just yet, because that would lead to huge performance> > > regressions in some test cases.> > > > I know it doesn't fit with your current way of doing things, but have> > you considered trying larger order allocations as a means of getting> > memory freed?> > Actually, I was thinking about that. What's your experience with this> approach?

You can't allocate the memory in the watermarks. Or at least, you're notsupposed to - it's supposed to be for 'emergency' allocations - sothings can still make progress in low memory situations. Personally, Ithink watermarks should be irrelevant in the hibernation case. We knowalmost exactly what's going on in the system. If our code is wellwritten, we should be able to account for every page being allocated andfreed. (Okay, maybe some leeway for the lowlevel bio code).