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

Last commit made on 2019-06-25
Get this branch:
git clone -b hibernate-arighi-v3b 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

Name:
hibernate-arighi-v3b
Repository:
lp:~kamalmostafa/ubuntu/+source/linux-aws/+git/xenial

Recent commits

5836c87... by Andrea Righi

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

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>

c7f43b8... by Andrea Righi

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

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>

223ff95... by Andrea Righi

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

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>
(cherry picked from commit 51ec38ccddf4955cde1b919f3c25792d61a594cf)

9353030... by Andrea Righi

UBUNTU: [Config] aws: disable CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS

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>

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

PM / hibernate: Simplify mark_unsafe_pages()

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>

3a2559a... by "Rafael J. Wysocki" <email address hidden>

PM / hibernate: Recycle safe pages after image restoration

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>

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

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

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>

44ebf28... by Keith Busch

NVMe: Allow request merges

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>

f9b66a4... by Kamal Mostafa

TEST KERNEL 4.4.0-1084.94+hibernate20190524

2b4e1f4... by Andrea Righi

UBUNTU SAUCE [aws]: mm: aggressive swapoff

Improve swapoff performance at the expense of the entire system
performance by avoiding to sleep on lock_page() in try_to_unuse().

This allows to trigger a read_swap_cache_async() on all the swapped out
pages and strongly increase swapoff performance (at the risk of
completely killing interactive performance).

Test case: swapoff called on a swap file containing about 32G of data in
a VM with 8 cpus, 64G RAM.

Result:

 - stock kernel:

 # time swapoff /swap-hibinit

 real 40m13.072s
 user 0m0.000s
 sys 17m18.971s

 - with this patch applied:

 # time swapoff /swap-hibinit

 real 1m59.496s
 user 0m0.000s
 sys 0m21.370s

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