mbox series

[SRU,D,/,B,aws-edge,aws,PULL] proper hibernation support

Message ID 20200116143411.GA23900@xps-13
State New
Headers show
Series [SRU,D,/,B,aws-edge,aws,PULL] proper hibernation support | expand

Pull-request

git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi

Message

Andrea Righi Jan. 16, 2020, 2:34 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1858618
BugLink: https://bugs.launchpad.net/bugs/1831940

The following patches are required to properly support hibernation with
bionic:linux-aws-edge / disco:linux-aws.

The most important patch is "PM / hibernate: memory_bm_find_bit():
Tighten node optimisation": this is a very critical bug fix for
hibernation that prevents potential memory corruptions on resume.

The two SAUCE patches are required to improve swapoff performance after
a successful resume.

All these patches have been tested in the AWS environment with positive
results.

The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:

  UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)

are available in the Git repository at:

  git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi

for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:

  UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)

----------------------------------------------------------------
Andrea Righi (2):
      UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
      UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic

Andy Whitcroft (1):
      PM / hibernate: memory_bm_find_bit(): Tighten node optimisation

Vineeth Remanan Pillai (2):
      mm: refactor swap-in logic out of shmem_getpage_gfp
      mm: rid swapoff of quadratic complexity

 include/linux/frontswap.h |   7 +
 include/linux/shmem_fs.h  |   3 +-
 kernel/power/snapshot.c   |   9 +-
 kernel/power/swap.c       |  24 +-
 mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
 mm/swap.c                 |   2 +-
 mm/swap_state.c           |  60 +---
 mm/swapfile.c             | 433 +++++++++++-----------------
 8 files changed, 582 insertions(+), 672 deletions(-)

Comments

Stefan Bader Jan. 16, 2020, 3:31 p.m. UTC | #1
On 16.01.20 15:34, Andrea Righi wrote:
> BugLink: https://bugs.launchpad.net/bugs/1858618
> BugLink: https://bugs.launchpad.net/bugs/1831940
> 
> The following patches are required to properly support hibernation with
> bionic:linux-aws-edge / disco:linux-aws.
> 
> The most important patch is "PM / hibernate: memory_bm_find_bit():
> Tighten node optimisation": this is a very critical bug fix for
> hibernation that prevents potential memory corruptions on resume.
> 
> The two SAUCE patches are required to improve swapoff performance after
> a successful resume.
> 
> All these patches have been tested in the AWS environment with positive
> results.
> 
> The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:
> 
>   UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi
> 
> for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:
> 
>   UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)
> 
> ----------------------------------------------------------------
> Andrea Righi (2):
>       UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
>       UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic
> 
> Andy Whitcroft (1):
>       PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
> 
> Vineeth Remanan Pillai (2):
>       mm: refactor swap-in logic out of shmem_getpage_gfp
>       mm: rid swapoff of quadratic complexity
> 
>  include/linux/frontswap.h |   7 +
>  include/linux/shmem_fs.h  |   3 +-
>  kernel/power/snapshot.c   |   9 +-
>  kernel/power/swap.c       |  24 +-
>  mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
>  mm/swap.c                 |   2 +-
>  mm/swap_state.c           |  60 +---
>  mm/swapfile.c             | 433 +++++++++++-----------------
>  8 files changed, 582 insertions(+), 672 deletions(-)
> 

Just to clarify: this seems very much targeted towards AWS, so I would put it
either into d/aws or (more likely the better place at this time) b/aws-5.0

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Colin Ian King Jan. 16, 2020, 3:37 p.m. UTC | #2
On 16/01/2020 14:34, Andrea Righi wrote:
> BugLink: https://bugs.launchpad.net/bugs/1858618
> BugLink: https://bugs.launchpad.net/bugs/1831940
> 
> The following patches are required to properly support hibernation with
> bionic:linux-aws-edge / disco:linux-aws.
> 
> The most important patch is "PM / hibernate: memory_bm_find_bit():
> Tighten node optimisation": this is a very critical bug fix for
> hibernation that prevents potential memory corruptions on resume.
> 
> The two SAUCE patches are required to improve swapoff performance after
> a successful resume.
> 
> All these patches have been tested in the AWS environment with positive
> results.
> 
> The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:
> 
>   UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi
> 
> for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:
> 
>   UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)
> 
> ----------------------------------------------------------------
> Andrea Righi (2):
>       UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
>       UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic
> 
> Andy Whitcroft (1):
>       PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
> 
> Vineeth Remanan Pillai (2):
>       mm: refactor swap-in logic out of shmem_getpage_gfp
>       mm: rid swapoff of quadratic complexity
> 
>  include/linux/frontswap.h |   7 +
>  include/linux/shmem_fs.h  |   3 +-
>  kernel/power/snapshot.c   |   9 +-
>  kernel/power/swap.c       |  24 +-
>  mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
>  mm/swap.c                 |   2 +-
>  mm/swap_state.c           |  60 +---
>  mm/swapfile.c             | 433 +++++++++++-----------------
>  8 files changed, 582 insertions(+), 672 deletions(-)
> 

I'm happy with these changes. Are any of these sauce patches upstream
material?

Acked-by: Colin Ian King <colin.king@canonical.com>
Andrea Righi Jan. 16, 2020, 4:14 p.m. UTC | #3
On Thu, Jan 16, 2020 at 03:37:12PM +0000, Colin Ian King wrote:
> On 16/01/2020 14:34, Andrea Righi wrote:
> > BugLink: https://bugs.launchpad.net/bugs/1858618
> > BugLink: https://bugs.launchpad.net/bugs/1831940
> > 
> > The following patches are required to properly support hibernation with
> > bionic:linux-aws-edge / disco:linux-aws.
> > 
> > The most important patch is "PM / hibernate: memory_bm_find_bit():
> > Tighten node optimisation": this is a very critical bug fix for
> > hibernation that prevents potential memory corruptions on resume.
> > 
> > The two SAUCE patches are required to improve swapoff performance after
> > a successful resume.
> > 
> > All these patches have been tested in the AWS environment with positive
> > results.
> > 
> > The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:
> > 
> >   UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)
> > 
> > are available in the Git repository at:
> > 
> >   git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi
> > 
> > for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:
> > 
> >   UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)
> > 
> > ----------------------------------------------------------------
> > Andrea Righi (2):
> >       UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
> >       UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic
> > 
> > Andy Whitcroft (1):
> >       PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
> > 
> > Vineeth Remanan Pillai (2):
> >       mm: refactor swap-in logic out of shmem_getpage_gfp
> >       mm: rid swapoff of quadratic complexity
> > 
> >  include/linux/frontswap.h |   7 +
> >  include/linux/shmem_fs.h  |   3 +-
> >  kernel/power/snapshot.c   |   9 +-
> >  kernel/power/swap.c       |  24 +-
> >  mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
> >  mm/swap.c                 |   2 +-
> >  mm/swap_state.c           |  60 +---
> >  mm/swapfile.c             | 433 +++++++++++-----------------
> >  8 files changed, 582 insertions(+), 672 deletions(-)
> > 
> 
> I'm happy with these changes. Are any of these sauce patches upstream
> material?

I'm working on making the swapoff optimization more suitable for
upstream. In particular, this should be a sysfs tunable (at least),
because optimizing swapoff at the cost of slowing down the entire system
can be really bad in many cases, but there are cases like this where you
may really want swapoff to complete as fast as possible.

Thanks,
-Andrea
Colin Ian King Jan. 16, 2020, 4:29 p.m. UTC | #4
On 16/01/2020 16:14, Andrea Righi wrote:
> On Thu, Jan 16, 2020 at 03:37:12PM +0000, Colin Ian King wrote:
>> On 16/01/2020 14:34, Andrea Righi wrote:
>>> BugLink: https://bugs.launchpad.net/bugs/1858618
>>> BugLink: https://bugs.launchpad.net/bugs/1831940
>>>
>>> The following patches are required to properly support hibernation with
>>> bionic:linux-aws-edge / disco:linux-aws.
>>>
>>> The most important patch is "PM / hibernate: memory_bm_find_bit():
>>> Tighten node optimisation": this is a very critical bug fix for
>>> hibernation that prevents potential memory corruptions on resume.
>>>
>>> The two SAUCE patches are required to improve swapoff performance after
>>> a successful resume.
>>>
>>> All these patches have been tested in the AWS environment with positive
>>> results.
>>>
>>> The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:
>>>
>>>   UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)
>>>
>>> are available in the Git repository at:
>>>
>>>   git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi
>>>
>>> for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:
>>>
>>>   UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)
>>>
>>> ----------------------------------------------------------------
>>> Andrea Righi (2):
>>>       UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
>>>       UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic
>>>
>>> Andy Whitcroft (1):
>>>       PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
>>>
>>> Vineeth Remanan Pillai (2):
>>>       mm: refactor swap-in logic out of shmem_getpage_gfp
>>>       mm: rid swapoff of quadratic complexity
>>>
>>>  include/linux/frontswap.h |   7 +
>>>  include/linux/shmem_fs.h  |   3 +-
>>>  kernel/power/snapshot.c   |   9 +-
>>>  kernel/power/swap.c       |  24 +-
>>>  mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
>>>  mm/swap.c                 |   2 +-
>>>  mm/swap_state.c           |  60 +---
>>>  mm/swapfile.c             | 433 +++++++++++-----------------
>>>  8 files changed, 582 insertions(+), 672 deletions(-)
>>>
>>
>> I'm happy with these changes. Are any of these sauce patches upstream
>> material?
> 
> I'm working on making the swapoff optimization more suitable for
> upstream. In particular, this should be a sysfs tunable (at least),
> because optimizing swapoff at the cost of slowing down the entire system
> can be really bad in many cases, but there are cases like this where you
> may really want swapoff to complete as fast as possible.

Nice. Thanks Andrea.
> 
> Thanks,
> -Andrea
>
Andrea Righi Jan. 27, 2020, 10:57 a.m. UTC | #5
Superseded. Will send a v2 today if tests are looking good.

-Andrea

On Thu, Jan 16, 2020 at 03:34:11PM +0100, Andrea Righi wrote:
> BugLink: https://bugs.launchpad.net/bugs/1858618
> BugLink: https://bugs.launchpad.net/bugs/1831940
> 
> The following patches are required to properly support hibernation with
> bionic:linux-aws-edge / disco:linux-aws.
> 
> The most important patch is "PM / hibernate: memory_bm_find_bit():
> Tighten node optimisation": this is a very critical bug fix for
> hibernation that prevents potential memory corruptions on resume.
> 
> The two SAUCE patches are required to improve swapoff performance after
> a successful resume.
> 
> All these patches have been tested in the AWS environment with positive
> results.
> 
> The following changes since commit 0f84693e79c7c596ac56d952851e0b9527679689:
> 
>   UBUNTU: Ubuntu-aws-edge-5.0.0-1019.21~18.04.1 (2019-10-03 00:49:16 -0400)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~arighi/+git/bionic-linux aws-edge-arighi
> 
> for you to fetch changes up to 65f789bf0216b2daf6377c2ba51d94cb8b76e5e1:
> 
>   UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic (2020-01-16 15:19:46 +0100)
> 
> ----------------------------------------------------------------
> Andrea Righi (2):
>       UBUNTU SAUCE [aws] PM / hibernate: reduce memory pressure during image writing
>       UBUNTU SAUCE [aws]: mm: swap: improve swap readahead heuristic
> 
> Andy Whitcroft (1):
>       PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
> 
> Vineeth Remanan Pillai (2):
>       mm: refactor swap-in logic out of shmem_getpage_gfp
>       mm: rid swapoff of quadratic complexity
> 
>  include/linux/frontswap.h |   7 +
>  include/linux/shmem_fs.h  |   3 +-
>  kernel/power/snapshot.c   |   9 +-
>  kernel/power/swap.c       |  24 +-
>  mm/shmem.c                | 716 +++++++++++++++++++++++++---------------------
>  mm/swap.c                 |   2 +-
>  mm/swap_state.c           |  60 +---
>  mm/swapfile.c             | 433 +++++++++++-----------------
>  8 files changed, 582 insertions(+), 672 deletions(-)