xref: /linux/mm/damon/Kconfig (revision 334fbe734e687404f346eba7d5d96ed2b44d35ab)
1# SPDX-License-Identifier: GPL-2.0-only
2
3menu "Data Access Monitoring"
4
5config DAMON
6	bool "DAMON: Data Access Monitoring Framework"
7	help
8	  This builds a framework that allows kernel subsystems to monitor
9	  access frequency of each memory region. The information can be useful
10	  for performance-centric DRAM level memory management.
11
12	  See https://www.kernel.org/doc/html/latest/mm/damon/index.html for
13	  more information.
14
15config DAMON_DEBUG_SANITY
16	bool "Check sanity of DAMON code"
17	depends on DAMON
18	help
19	  This enables additional DAMON debugging-purpose sanity checks in
20	  DAMON code.  This can be useful for finding bugs, but impose
21	  additional overhead.  This is therefore recommended to be enabled on
22	  only development and test setups.
23
24	  If unsure, say N.
25
26config DAMON_KUNIT_TEST
27	bool "Test for damon" if !KUNIT_ALL_TESTS
28	depends on DAMON && KUNIT=y
29	default KUNIT_ALL_TESTS
30	help
31	  This builds the DAMON Kunit test suite.
32
33	  For more information on KUnit and unit tests in general, please refer
34	  to the KUnit documentation.
35
36	  If unsure, say N.
37
38config DAMON_VADDR
39	bool "Data access monitoring operations for virtual address spaces"
40	depends on DAMON && MMU
41	select PAGE_IDLE_FLAG
42	default DAMON
43	help
44	  This builds the default data access monitoring operations for DAMON
45	  that work for virtual address spaces.
46
47config DAMON_PADDR
48	bool "Data access monitoring operations for the physical address space"
49	depends on DAMON && MMU
50	select PAGE_IDLE_FLAG
51	default DAMON
52	help
53	  This builds the default data access monitoring operations for DAMON
54	  that works for the physical address space.
55
56config DAMON_VADDR_KUNIT_TEST
57	bool "Test for DAMON operations" if !KUNIT_ALL_TESTS
58	depends on DAMON_VADDR && KUNIT=y
59	default KUNIT_ALL_TESTS
60	help
61	  This builds the DAMON virtual addresses operations Kunit test suite.
62
63	  For more information on KUnit and unit tests in general, please refer
64	  to the KUnit documentation.
65
66	  If unsure, say N.
67
68config DAMON_SYSFS
69	bool "DAMON sysfs interface"
70	depends on DAMON && SYSFS
71	default DAMON
72	help
73	  This builds the sysfs interface for DAMON.  The user space can use
74	  the interface for arbitrary data access monitoring.
75
76config DAMON_SYSFS_KUNIT_TEST
77	bool "Test for damon sysfs interface" if !KUNIT_ALL_TESTS
78	depends on DAMON_SYSFS && KUNIT=y
79	default KUNIT_ALL_TESTS
80	help
81	  This builds the DAMON sysfs interface Kunit test suite.
82
83	  For more information on KUnit and unit tests in general, please refer
84	  to the KUnit documentation.
85
86	  If unsure, say N.
87
88config DAMON_RECLAIM
89	bool "Build DAMON-based reclaim (DAMON_RECLAIM)"
90	depends on DAMON_PADDR
91	help
92	  This builds the DAMON-based reclamation subsystem.  It finds pages
93	  that not accessed for a long time (cold) using DAMON and reclaim
94	  those.
95
96	  This is suggested to be used as a proactive and lightweight
97	  reclamation under light memory pressure, while the traditional page
98	  scanning-based reclamation is used for heavy pressure.
99
100config DAMON_LRU_SORT
101	bool "Build DAMON-based LRU-lists sorting (DAMON_LRU_SORT)"
102	depends on DAMON_PADDR
103	help
104	  This builds the DAMON-based LRU-lists sorting subsystem.  It tries to
105	  protect frequently accessed (hot) pages while rarely accessed (cold)
106	  pages reclaimed first under memory pressure.
107
108config DAMON_STAT
109	bool "Build data access monitoring stat (DAMON_STAT)"
110	depends on DAMON_PADDR
111	help
112	  This builds the DAMON-based access monitoring statistics subsystem.
113	  It runs DAMON and expose access monitoring results in simple stat
114	  metrics.
115
116config DAMON_STAT_ENABLED_DEFAULT
117	bool "Enable DAMON_STAT by default"
118	depends on DAMON_STAT
119	default DAMON_STAT
120	help
121	  Whether to enable DAMON_STAT by default.  Users can disable it in
122	  boot or runtime using its 'enabled' parameter.
123
124endmenu
125