diff mbox series

[v2,15/16] mm: multigenerational lru: Kconfig

Message ID 20210413065633.2782273-16-yuzhao@google.com (mailing list archive)
State New
Headers show
Series Multigenerational LRU Framework | expand

Commit Message

Yu Zhao April 13, 2021, 6:56 a.m. UTC
Add configuration options for the multigenerational lru.

Signed-off-by: Yu Zhao <yuzhao@google.com>
---
 mm/Kconfig | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

Comments

kernel test robot April 13, 2021, 4:19 p.m. UTC | #1
Hi Yu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on cgroup/for-next tip/x86/mm fuse/for-next tip/perf/core tip/sched/core linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210413]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 99cb64de36d5c9397a664808b92943e35bdce25e
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
        git checkout f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
        # save the attached .config to linux build tree
        make W=1 ARCH=um 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
   mm/vmscan.c: In function 'walk_pmd_range_unlocked':
>> mm/vmscan.c:5055:24: error: implicit declaration of function 'pmd_pfn'; did you mean 'pmd_off'? [-Werror=implicit-function-declaration]
    5055 |    unsigned long pfn = pmd_pfn(val);
         |                        ^~~~~~~
         |                        pmd_off
>> mm/vmscan.c:5057:9: error: implicit declaration of function 'pmd_young'; did you mean 'pte_young'? [-Werror=implicit-function-declaration]
    5057 |    if (!pmd_young(val)) {
         |         ^~~~~~~~~
         |         pte_young
   cc1: some warnings being treated as errors
--
   cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
   mm/memcontrol.c: In function 'mem_cgroup_attach':
>> mm/memcontrol.c:6176:3: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
    6176 |   ;
         |   ^


vim +5055 mm/vmscan.c

4aa138b42a5c9f Yu Zhao 2021-04-13  5029  
4aa138b42a5c9f Yu Zhao 2021-04-13  5030  static bool walk_pmd_range_unlocked(pud_t *pud, unsigned long start, unsigned long end,
4aa138b42a5c9f Yu Zhao 2021-04-13  5031  				    struct mm_walk *walk)
4aa138b42a5c9f Yu Zhao 2021-04-13  5032  {
4aa138b42a5c9f Yu Zhao 2021-04-13  5033  	int i;
4aa138b42a5c9f Yu Zhao 2021-04-13  5034  	pmd_t *pmd;
4aa138b42a5c9f Yu Zhao 2021-04-13  5035  	unsigned long next;
4aa138b42a5c9f Yu Zhao 2021-04-13  5036  	int young = 0;
4aa138b42a5c9f Yu Zhao 2021-04-13  5037  	struct mm_walk_args *args = walk->private;
4aa138b42a5c9f Yu Zhao 2021-04-13  5038  
4aa138b42a5c9f Yu Zhao 2021-04-13  5039  	VM_BUG_ON(pud_leaf(*pud));
4aa138b42a5c9f Yu Zhao 2021-04-13  5040  
4aa138b42a5c9f Yu Zhao 2021-04-13  5041  	pmd = pmd_offset(pud, start & PUD_MASK);
4aa138b42a5c9f Yu Zhao 2021-04-13  5042  restart:
4aa138b42a5c9f Yu Zhao 2021-04-13  5043  	for (i = pmd_index(start); start != end; i++, start = next) {
4aa138b42a5c9f Yu Zhao 2021-04-13  5044  		pmd_t val = pmd_read_atomic(pmd + i);
4aa138b42a5c9f Yu Zhao 2021-04-13  5045  
4aa138b42a5c9f Yu Zhao 2021-04-13  5046  		next = pmd_addr_end(start, end);
4aa138b42a5c9f Yu Zhao 2021-04-13  5047  
4aa138b42a5c9f Yu Zhao 2021-04-13  5048  		barrier();
4aa138b42a5c9f Yu Zhao 2021-04-13  5049  		if (!pmd_present(val) || is_huge_zero_pmd(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13  5050  			args->mm_stats[MM_LEAF_HOLE]++;
4aa138b42a5c9f Yu Zhao 2021-04-13  5051  			continue;
4aa138b42a5c9f Yu Zhao 2021-04-13  5052  		}
4aa138b42a5c9f Yu Zhao 2021-04-13  5053  
4aa138b42a5c9f Yu Zhao 2021-04-13  5054  		if (pmd_trans_huge(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13 @5055  			unsigned long pfn = pmd_pfn(val);
4aa138b42a5c9f Yu Zhao 2021-04-13  5056  
4aa138b42a5c9f Yu Zhao 2021-04-13 @5057  			if (!pmd_young(val)) {
4aa138b42a5c9f Yu Zhao 2021-04-13  5058  				args->mm_stats[MM_LEAF_OLD]++;
4aa138b42a5c9f Yu Zhao 2021-04-13  5059  				continue;
4aa138b42a5c9f Yu Zhao 2021-04-13  5060  			}
4aa138b42a5c9f Yu Zhao 2021-04-13  5061  
4aa138b42a5c9f Yu Zhao 2021-04-13  5062  			if (pfn < args->start_pfn || pfn >= args->end_pfn) {
4aa138b42a5c9f Yu Zhao 2021-04-13  5063  				args->mm_stats[MM_LEAF_OTHER_NODE]++;
4aa138b42a5c9f Yu Zhao 2021-04-13  5064  				continue;
4aa138b42a5c9f Yu Zhao 2021-04-13  5065  			}
4aa138b42a5c9f Yu Zhao 2021-04-13  5066  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot April 14, 2021, 4:54 a.m. UTC | #2
Hi Yu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on cgroup/for-next tip/x86/mm fuse/for-next tip/perf/core tip/sched/core linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210413]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 99cb64de36d5c9397a664808b92943e35bdce25e
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
        git checkout f05f4c64bb8f0b8bcc40c9931f51bffdb6502cdd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> mm/vmscan.c:4704:16: error: variably modified 'bitmap' at file scope
    4704 |  unsigned long bitmap[BITS_TO_LONGS(PTRS_PER_PMD)];
         |                ^~~~~~


vim +/bitmap +4704 mm/vmscan.c

46b27b9e9608eb Yu Zhao 2021-04-13  4691  
46b27b9e9608eb Yu Zhao 2021-04-13  4692  struct mm_walk_args {
46b27b9e9608eb Yu Zhao 2021-04-13  4693  	struct mem_cgroup *memcg;
46b27b9e9608eb Yu Zhao 2021-04-13  4694  	unsigned long max_seq;
46b27b9e9608eb Yu Zhao 2021-04-13  4695  	unsigned long next_addr;
46b27b9e9608eb Yu Zhao 2021-04-13  4696  	unsigned long start_pfn;
46b27b9e9608eb Yu Zhao 2021-04-13  4697  	unsigned long end_pfn;
46b27b9e9608eb Yu Zhao 2021-04-13  4698  	int node_id;
46b27b9e9608eb Yu Zhao 2021-04-13  4699  	int batch_size;
46b27b9e9608eb Yu Zhao 2021-04-13  4700  	int mm_stats[NR_MM_STATS];
46b27b9e9608eb Yu Zhao 2021-04-13  4701  	int nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES];
46b27b9e9608eb Yu Zhao 2021-04-13  4702  	bool should_walk[ANON_AND_FILE];
46b27b9e9608eb Yu Zhao 2021-04-13  4703  #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG)
46b27b9e9608eb Yu Zhao 2021-04-13 @4704  	unsigned long bitmap[BITS_TO_LONGS(PTRS_PER_PMD)];
46b27b9e9608eb Yu Zhao 2021-04-13  4705  #endif
46b27b9e9608eb Yu Zhao 2021-04-13  4706  };
46b27b9e9608eb Yu Zhao 2021-04-13  4707  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/mm/Kconfig b/mm/Kconfig
index 24c045b24b95..0be1c6c90cc0 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -872,4 +872,59 @@  config MAPPING_DIRTY_HELPERS
 config KMAP_LOCAL
 	bool
 
+config LRU_GEN
+	bool "Multigenerational LRU"
+	depends on MMU
+	help
+	  A high performance LRU implementation to heavily overcommit workloads
+	  that are not IO bound. See Documentation/vm/multigen_lru.rst for
+	  details.
+
+	  Warning: do not enable this option unless you plan to use it because
+	  it introduces a small per-process and per-memcg and per-node memory
+	  overhead.
+
+config NR_LRU_GENS
+	int "Max number of generations"
+	depends on LRU_GEN
+	range 4 31
+	default 7
+	help
+	  This will use order_base_2(N+1) spare bits from page flags.
+
+	  Warning: do not use numbers larger than necessary because each
+	  generation introduces a small per-node and per-memcg memory overhead.
+
+config TIERS_PER_GEN
+	int "Number of tiers per generation"
+	depends on LRU_GEN
+	range 2 5
+	default 4
+	help
+	  This will use N-2 spare bits from page flags.
+
+	  Higher values generally offer better protection to active pages under
+	  heavy buffered I/O workloads.
+
+config LRU_GEN_ENABLED
+	bool "Turn on by default"
+	depends on LRU_GEN
+	help
+	  The default value of /sys/kernel/mm/lru_gen/enabled is 0. This option
+	  changes it to 1.
+
+	  Warning: the default value is the fast path. See
+	  Documentation/static-keys.txt for details.
+
+config LRU_GEN_STATS
+	bool "Full stats for debugging"
+	depends on LRU_GEN
+	help
+	  This option keeps full stats for each generation, which can be read
+	  from /sys/kernel/debug/lru_gen_full.
+
+	  Warning: do not enable this option unless you plan to use it because
+	  it introduces an additional small per-process and per-memcg and
+	  per-node memory overhead.
+
 endmenu