Skip to content

PM: Drop shrink_all_memory (was: Re: [Bug #13058] First hibernation attempt fails)

Rafael J. Wysocki kernel-testers linux-acpi linux-pm linux-scsi linux-wireless lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3PM: Disable OOM killer during system-wide power transitionsinclude/linux/suspend.h kernel/power/disk.c kernel/power/main.c +2 more+36 -36 replies
1/3PM: Disable OOM killer during system-wide power transitionsinclude/linux/suspend.h kernel/power/disk.c kernel/power/main.c +2 more+36 -30 replies
2/3PM/Hibernate: Move memory shrinking to snapshot.ckernel/power/snapshot.c kernel/power/swsusp.c+76 -760 replies
2/3PM/Hibernate: Move memory shrinking to snapshot.ckernel/power/snapshot.c kernel/power/swsusp.c+76 -760 replies
3/3PM/Hibernate: Use memory allocations to free memorykernel/power/main.c kernel/power/snapshot.c mm/vmscan.c+93 -192206 replies
3/3PM/Hibernate: Use memory allocations to free memorykernel/power/main.c kernel/power/snapshot.c mm/vmscan.c+93 -1920 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchPavel Machek
1/3
1/3
2/3
2/3
3/3A-b A-b
3/3A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] PM: Drop shrink_all_memory (was: Re: [Bug #13058] First hibernation attempt fails)
Quoted 31 lines · Andrew Morton
Quoted 19 lines · On Wed, 22 Apr 2009 22:11:17 +0200 "Rafael J. Wysocki"…
Quoted 9 lines · Pavel Machek

Hi!

Quoted 7 lines

Of course, this will protect the calling task from getting oom-killed. But it doesn't protect other tasks from getting oom-killed due to the activity of _this_ task.

But I think that problem already exists, and that this proposal doesn't worsen anything, yes?

Quoted 8 lines
Quoted 2 lines

Or is it the case that all other tasks are safely stuck in the freezer at this time, so they won't be allocating any memory anyway?

That is the idea, yes. ... but we now have more threads that are not freezable... so they may allocate the memory.

Is it non-feasible to free memory without really going and allocating everything?

Quoted 8 lines

The question is whether there is a point. In principle we can just go and allocate as much as we need upfront. It shouldn't change anything, because we resume and suspend devices after creating the image anyway.

I think we could try to disable the OOM killer before suspend and just allocate the memory for the image right before devices are suspended for the first time.

Quoted 7 lines

It would be nice to do.

shrink_all_memory() is simply trying to do something which page reclaim doesn't expect to do (free memory when there's already lots of memory free). Consequently it doesn't do it very well, and there's a good risk that changes to core reclaim will accidentally break shrink_all_memory().

OK, a patchset follows:

[1/3] - disable the OOM killer during system-wide power transitions (should be
done anyway IMO)
[2/3] - move swsusp_shrink_memory() to kernel/power/snapshot.c so that the
next patch is easier to read
[3/3] - drop shrink_all_memory()

Please have a look and tell me what you think.

Thanks,
Rafael