Skip to content

RFC PM/Hibernate: Rework memory shrinking (rev. 3)

Rafael J. Wysocki linux-mm linux-pm lkml 1 version NAK

Status from this message: Nack, unnecessary in mmotm and my patch series from

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 70 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/6mm: Introduce __GFP_NO_OOM_KILLinclude/linux/gfp.h mm/page_alloc.c+8 -30 replies
1/6mm: Introduce __GFP_NO_OOM_KILLinclude/linux/gfp.h mm/page_alloc.c+8 -38 replies
1/6PM/Suspend: Do not shrink memory before suspendkernel/power/main.c mm/vmscan.c+3 -210 replies
1/6PM/Suspend: Do not shrink memory before suspendkernel/power/main.c mm/vmscan.c+3 -210 replies
2/6PM/Suspend: Do not shrink memory before suspendkernel/power/main.c mm/vmscan.c+3 -210 replies
2/6PM/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/6PM/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/6PM/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/6PM/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/6mm, PM/Freezer: Disable OOM killer when tasks are frozeninclude/linux/gfp.h kernel/power/process.c mm/page_alloc.c+22 -00 replies
3/6mm, PM/Freezer: Disable OOM killer when tasks are frozeninclude/linux/gfp.h kernel/power/process.c mm/page_alloc.c+22 -08 replies
4/6PM/Hibernate: Rework shrinking of memorykernel/power/snapshot.c+165 -440 replies
4/6PM/Hibernate: Rework shrinking of memorykernel/power/snapshot.c+165 -440 replies
4/6PM/Hibernate: Rework shrinking of memorykernel/power/snapshot.c+168 -470 replies
4/6PM/Hibernate: Rework shrinking of memorykernel/power/snapshot.c+168 -4716 replies
5/6PM/Hibernate: Do not release preallocated memory unnecessarilykernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+130 -730 replies
5/6PM/Hibernate: Do not release preallocated memory unnecessarilykernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+130 -732 replies
5/6PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2)kernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+149 -740 replies
5/6PM/Hibernate: Do not release preallocated memory unnecessarily (rev. 2)kernel/power/disk.c kernel/power/power.h kernel/power/snapshot.c+149 -748 replies
6/6PM/Hibernate: Estimate hard core working set sizekernel/power/snapshot.c+44 -00 replies
6/6PM/Hibernate: Estimate hard core working set sizekernel/power/snapshot.c+44 -02 replies
6/6PM/Hibernate: Do not try to allocate too much memory too hardkernel/power/snapshot.c+52 -40 replies
6/6PM/Hibernate: Do not try to allocate too much memory too hardkernel/power/snapshot.c+52 -426 replies

Reviews trailers per patch

19 of 23 patches have a Reviewed-by or Acked-by.

PatchNigel CunninghamWu FengguangPavel MachekRafael J. Wysocki
1/6A-b A-b A-b A-b
1/6A-b A-b A-b A-b
1/6A-b A-b A-b A-b
1/6A-b A-b A-b A-b
2/6A-b A-b A-b A-b A-b A-b
2/6A-b A-b A-b A-b A-b A-b
2/6A-b A-b A-b A-b A-b A-b
3/6A-b A-b A-b A-b A-b A-b
3/6A-b A-b A-b A-b A-b A-b
3/6A-b A-b A-b A-b A-b A-b
3/6A-b A-b A-b A-b A-b A-b
4/6A-b A-b
4/6A-b A-b
4/6A-b A-b
4/6A-b A-b
5/6
5/6
5/6
5/6
6/6A-b A-b Not-yet-signed-off-by Not-yet-signed-off-by
6/6A-b A-b Not-yet-signed-off-by Not-yet-signed-off-by
6/6A-b A-b Not-yet-signed-off-by Not-yet-signed-off-by
6/6A-b A-b Not-yet-signed-off-by Not-yet-signed-off-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [RFC][PATCH 0/6] PM/Hibernate: Rework memory shrinking (rev. 3)
Quoted 15 lines · Rafael J. Wysocki
Quoted 14 lines · Rafael J. Wysocki

Hi,

The following patchset is an attempt to rework the memory shrinking mechanism used during hibernation to make room for the image. It is a work in progress and most likely it's going to be modified, but it has been discussed recently and I'd like to get comments on the current version.

[1/5] - disable the OOM kernel after freezing tasks (this will be dropped if
it's verified that we can avoid the OOM killing by using __GFP_FS|__GFP_WAIT|__GFP_NORETRY|__GFP_NOWARN
in the next patches).

[2/5] - drop memory shrinking from the suspend (to RAM) code path

Quoted 8 lines
Quoted 6 lines

[3/5] - move swsusp_shrink_memory() to snapshot.c

[4/5] - rework swsusp_shrink_memory() (to use memory allocations for applying
memory pressure)

[5/5] - allocate image pages along with the shrinking.

Updated patchset follows.

I the meantime I added a patch that attempts to computer the size of the hard core working set. I also had to rework the patch reworking swsusp_shrink_memory() so that it takes highmem into account.

Currently, the patchset consists of the following patches:

[1/6] - disable the OOM kernel after freezing tasks (this will be dropped if
it's verified that we can avoid the OOM killing by using __GFP_FS|__GFP_WAIT|__GFP_NORETRY|__GFP_NOWARN
in the next patches).

[2/6] - drop memory shrinking from the suspend (to RAM) code path

[3/6] - move swsusp_shrink_memory() to snapshot.c

[4/6] - rework swsusp_shrink_memory() (to use memory allocations for applying
memory pressure)

[5/6] - allocate image pages along with the shrinking

[6/6] - estimate the size of the hard core working set and use it as the lower
limit of the image size.

Comments welcome.

Thanks,
Rafael