~kamalmostafa/ubuntu/+source/linux-aws/+git/xenial:hibernate-0626

Last commit made on 2019-06-26
Get this branch:
git clone -b hibernate-0626 https://git.launchpad.net/~kamalmostafa/ubuntu/+source/linux-aws/+git/xenial
Only Kamal Mostafa can upload to this branch. If you are Kamal Mostafa please log in for upload directions.

Branch merges

Branch information

Recent commits

5261da2... by Kamal Mostafa

TEST KERNEL 4.4.0-1087.98+hibernate20190626

bb1cb03... by Andrea Righi

UBUNTU SAUCE [aws] mm, page_alloc: disable fair zone allocation policy on hibernate

BugLink: https://bugs.launchpad.net/bugs/1831940

The fair zone allocation policy interleaves allocation requests between
zones to avoid an age inversion problem whereby new pages are reclaimed
to balance a zone.

Get rid of this complexity when tasks are frozen during hibernation.
This allows to improve hibernation performance and reduce the risk of
OOMs.

Signed-off-by: Andrea Righi <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>

c37fe1f... by Andrea Righi

UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing

BugLink: https://bugs.launchpad.net/bugs/1831940

Get rid of the reqd_free_pages logic and make sure I/O requests are
completed every time a swap page is written.

This allows to reduce the risk of running out of memory during hibernate
if the system is under memory pressure.

Signed-off-by: Andrea Righi <email address hidden>

2222d96... by Andrea Righi

UBUNTU SAUCE [aws] PM / hibernate: set image_size to total RAM size by default

BugLink: https://bugs.launchpad.net/bugs/1831940

If the size of the image created when hibernating is bigger than
image_size the kernel will try to reduce the size of the image. This can
slow down hibernation consistenly, so setting image_size to the total
amount of RAM by default ensures that the kernel doesn't waste time to
reduce the image, making hibernation faster.

Signed-off-by: Andrea Righi <email address hidden>

e1a7387... by Andrea Righi

UBUNTU: [Config] aws: disable CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS

BugLink: https://bugs.launchpad.net/bugs/1831940

When swapping out THP (Transparent Huge Pages), sometimes we have to
fallback to split the THP into normal pages before swapping, because no
free swap clusters are available. This can make hibernation really slow
under memory pressure, so disable transparent huge pages by default.

Signed-off-by: Andrea Righi <email address hidden>

5919dde... by "Rafael J. Wysocki" <email address hidden>

PM / hibernate: Simplify mark_unsafe_pages()

BugLink: https://bugs.launchpad.net/bugs/1831940

Rework mark_unsafe_pages() to use a simpler method of clearing
all bits in free_pages_map and to set the bits for the "unsafe"
pages (ie. pages that were used by the image kernel before
hibernation) with the help of duplicate_memory_bitmap().

For this purpose, move the pfn_valid() check from mark_unsafe_pages()
to unpack_orig_pfns() where the "unsafe" pages are discovered.

Signed-off-by: Rafael J. Wysocki <email address hidden>
(cherry picked from commit 6dbecfd345a617888da370b13d5b190c9ff3df53)
Signed-off-by: Andrea Righi <email address hidden>

351f176... by "Rafael J. Wysocki" <email address hidden>

PM / hibernate: Recycle safe pages after image restoration

BugLink: https://bugs.launchpad.net/bugs/1831940

One of the memory bitmaps used by the hibernation image restoration
code is freed after the image has been loaded.

That is not quite efficient, though, because the memory pages used
for building that bitmap are known to be safe (ie. they were not
used by the image kernel before hibernation) and the arch-specific
code finalizing the image restoration may need them. In that case
it needs to allocate those pages again via the memory management
subsystem, check if they are really safe again by consulting the
other bitmaps and so on.

To avoid that, recycle those pages by putting them into the global
list of known safe pages so that they can be given to the arch code
right away when necessary.

Signed-off-by: Rafael J. Wysocki <email address hidden>
(cherry picked from commit 307c5971c972ef2bfd541d2850b36a692c6354c9)
Signed-off-by: Andrea Righi <email address hidden>

ef3b63d... by "Rafael J. Wysocki" <email address hidden>

PM / hibernate: Do not free preallocated safe pages during image restore

BugLink: https://bugs.launchpad.net/bugs/1831940

The core image restoration code preallocates some safe pages
(ie. pages that weren't used by the image kernel before hibernation)
for future use before allocating the bulk of memory for loading the
image data. Those safe pages are then freed so they can be allocated
again (with the memory management subsystem's help). That's done to
ensure that there will be enough safe pages for temporary data
structures needed during image restoration.

However, it is not really necessary to free those pages after they
have been allocated. They can be added to the (global) list of
safe pages right away and then picked up from there when needed
without freeing.

That reduces the overhead related to using safe pages, especially
in the arch-specific code, so modify the code accordingly.

Signed-off-by: Rafael J. Wysocki <email address hidden>
(cherry picked from commit 9c744481c003697de453e8fc039468143ba604aa)
Signed-off-by: Andrea Righi <email address hidden>

e0f34ae... by Keith Busch

NVMe: Allow request merges

BugLink: https://bugs.launchpad.net/bugs/1831940

It is generally more efficient to submit larger IO.

Signed-off-by: Keith Busch <email address hidden>
Reviewed-by: Johannes Thumshirn <email address hidden>
Reviewed-by: Sagi Grimberg <email address hidden>
Signed-off-by: Jens Axboe <email address hidden>
(cherry picked from commit ef2d4615c59efb312e531a5e949970f37ca1c841)
Signed-off-by: Andrea Righi <email address hidden>

f15b8c8... by Andrea Righi

UBUNTU SAUCE [aws]: PM / hibernate: make sure pm_async is always disabled

BugLink: https://bugs.launchpad.net/bugs/1831940

We have experienced deadlock conditions on hibernate under memory
pressure with pm_async enabled.

To prevent such deadlocks make sure that pm_async is never enabled.

Signed-off-by: Andrea Righi <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>