Skip to content

PM: Drop shrink_all_memory (rev. 2) (was: Re: [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory)

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 Latest4 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm: Add __GFP_NO_OOM_KILL flaginclude/linux/gfp.h mm/page_alloc.c+4 -22 replies
1/4mm: Add __GFP_NO_OOM_KILL flaginclude/linux/gfp.h mm/page_alloc.c+4 -20 replies
2/4PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2)kernel/power/power.h kernel/power/snapshot.c kernel/power/swsusp.c+79 -810 replies
2/4PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2)kernel/power/power.h kernel/power/snapshot.c kernel/power/swsusp.c+79 -810 replies
3/4PM/Hibernate: Use memory allocations to free memory (rev. 2)kernel/power/main.c kernel/power/snapshot.c mm/vmscan.c+101 -19318 replies
3/4PM/Hibernate: Use memory allocations to free memory (rev. 2)kernel/power/main.c kernel/power/snapshot.c mm/vmscan.c+101 -1930 replies
4/4PM/Hibernate: Do not release preallocated memory unnecessarilykernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+87 -810 replies
4/4PM/Hibernate: Do not release preallocated memory unnecessarilykernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+87 -810 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

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

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/4] PM: Drop shrink_all_memory (rev. 2) (was: Re: [PATCH 3/3] PM/Hibernate: Use memory allocations to free memory)
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Sat, 2 May 2009 13:46:34 +0200 "Rafael J. Wysocki"…
Quoted 3 lines

Do we need the bitmap? I expect we can just string all these pages onto a local list via page.lru. Would need to check that - the pageframe fields are quite overloaded.

Quoted 8 lines
Quoted 1 line

This is the reason why we use the bitmaps for hibernation. :-)

grep the tree for page->lru and you'll see that quite a few page consumers are using it. So you'd be pretty safe doing it this way.

Whether it's _worth_ doing it this way is debatable, given that hibernation uses bitmaps elsewhere. But it would shrink the patch a bit I expect?

It probably would, but it turns out we need not create the new bitmap, we can use the existing ones for marking the allocated pages. That also has the benefit that we can use swsusp_free() to release them.

Modified patch series follows:

[1/4] - your patch introducing __GFP_NO_OOM_KILL (I decided it would be better
do it this way in this particular case. The fact that the OOM killer is not going to work after tasks have been frozen is a different issue.)

[2/4] - move swsusp_shrink_memory to snapshot.c, no major changes

[3/4] - use memory allocations to for making the room for the image (added
comments, used the existing bitmaps, cleaned up a bit)

[4/4] - new thing: do not release memory allocated by [3/4] and use it for
creating the image directly.

Thanks,
Rafael