Whamcloud - gitweb
LU-17463 osc: add support for unevictable mlock()ed pages
The page cache shrinker does not distinguish mlock()ed pages from
normal unused pages in page LRU list and would remove it from
cache wrongly.
In this patch, we use a separate unevictable list to manage the
pages marked with PG_mlocked flag.
As there is no direct notification or interface for page mlock()/
munlock() to the filesystem, we need to scan the whole unevitable
list heavily to check whether there are any freeable pages in the
list to remove them later.
Thus we implement two interfaces to scan and shrink unevictable
pages that no longer marked with PG_mlocked and remove them
from cache manually.
- $LCTL set_param llite.*.unevict_cached_mb=clear
Scan and clear all pages in unevictable lists that no
longer marked with PG_mlocked on a Lustre client FS.
Scan the normal LRU list to move the pages marked with
PG_mlocked into the unevictable list.
- $LCTL set_param osc.*.osc_unevict_cached_mb=clear
Scan and clear all pages that no longer marked with PG_mlocked
in the unevictable list corresponding to this OSC obd device.
Scan the normal LRU list to move the pages marked with
PG_mlocked into the unevictable list.
The command "echo 3 > /proc/sys/vm/drop_caches" can also be
used to evict the pages unlocked by munlock() system call which
are no longer marked with PG_mlocked.
In our design, the mlocked pages are not accounted into the LRU.
Thus, the total cached pages in a Lustre client FS may exceed
the maximum LRU limit @max_cached_mb on a Lustre client FS.
Add a tunable parameter to control whether the mlocked pages
functionality is enabled:
llite.*.enable_mlock_pages
This will allow disabling this feature if something goes wrong in
the feild.
It is disabled by default.
Add test case sanity/test_600{a,b,c,d}.
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I0713ad254999dfc32ed5063ec0d8e042968793a9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53826
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <patrick.farrell@oracle.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
15 files changed: