lkml.org 
[lkml]   [2020]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] mm: swap: use fixed-size readahead during swapoff
Date
Andrea Righi <andrea.righi@canonical.com> writes:

> The global swap-in readahead policy takes in account the previous access
> patterns, using a scaling heuristic to determine the optimal readahead
> chunk dynamically.
>
> This works pretty well in most cases, but like any heuristic there are
> specific cases when this approach is not ideal, for example the swapoff
> scenario.
>
> During swapoff we just want to load back into memory all the swapped-out
> pages and for this specific use case a fixed-size readahead is more
> efficient.
>
> The specific use case this patch is addressing is to improve swapoff
> performance when a VM has been hibernated, resumed and all memory needs
> to be forced back to RAM by disabling swap (see the test case below).

Why do you need to swapoff after resuming? The swap device isn't used
except hibernation? I guess the process is,

1) add swap device to VM
2) hibernate
3) resume
4) swapoff

Some pages are swapped out in step 2? If os, can we just set
/proc/sys/vm/swappiness to 0 to avoid swapping in step 2?

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2020-04-13 15:14    [W:0.440 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site