Skip to content

Commit

Permalink
mm/damon: introduce DAMON-based LRU-lists Sorting
Browse files Browse the repository at this point in the history
Users can do data access-aware LRU-lists sorting using 'LRU_PRIO' and
'LRU_DEPRIO' DAMOS actions.  However, finding best parameters including
the hotness/coldness thresholds, CPU quota, and watermarks could be
challenging for some users.  To make the scheme easy to be used without
complex tuning for common situations, this commit implements a static
kernel module called 'DAMON_LRU_SORT' using the 'LRU_PRIO' and
'LRU_DEPRIO' DAMOS actions.

It proactively sorts LRU-lists using DAMON with conservatively chosen
default values of the parameters.  That is, the module under its default
parameters will make no harm for common situations but provide some level
of efficiency improvements for systems having clear hot/cold access
pattern under a level of memory pressure while consuming only a limited
small portion of CPU time.

Link: https://lkml.kernel.org/r/20220613192301.8817-9-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
sjp38 authored and akpm00 committed Jul 4, 2022
1 parent b57e39a commit 40e983c
Show file tree
Hide file tree
Showing 3 changed files with 555 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mm/damon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,12 @@ config DAMON_RECLAIM
reclamation under light memory pressure, while the traditional page
scanning-based reclamation is used for heavy pressure.

config DAMON_LRU_SORT
bool "Build DAMON-based LRU-lists sorting (DAMON_LRU_SORT)"
depends on DAMON_PADDR
help
This builds the DAMON-based LRU-lists sorting subsystem. It tries to
protect frequently accessed (hot) pages while rarely accessed (cold)
pages reclaimed first under memory pressure.

endmenu
1 change: 1 addition & 0 deletions mm/damon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ obj-$(CONFIG_DAMON_PADDR) += ops-common.o paddr.o
obj-$(CONFIG_DAMON_SYSFS) += sysfs.o
obj-$(CONFIG_DAMON_DBGFS) += dbgfs.o
obj-$(CONFIG_DAMON_RECLAIM) += reclaim.o
obj-$(CONFIG_DAMON_LRU_SORT) += lru_sort.o
Loading

0 comments on commit 40e983c

Please sign in to comment.