Message ID | 20220818090430.2859992-3-mawupeng1@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | watermark related improvement on zone movable | expand |
Hi Wupeng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20220818]
url: https://github.com/intel-lab-lkp/linux/commits/Wupeng-Ma/watermark-related-improvement-on-zone-movable/20220818-170659
base: 5b6a4bf680d61b1dd26629840f848d0df8983c62
config: s390-randconfig-r011-20220818 (https://download.01.org/0day-ci/archive/20220818/202208181955.CIEgocmg-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/d126658752d146244ef366f63b8edbb797dc5436
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Wupeng-Ma/watermark-related-improvement-on-zone-movable/20220818-170659
git checkout d126658752d146244ef366f63b8edbb797dc5436
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
s390-linux-ld: mm/page_alloc.o: in function `watermark_scale_factor_sysctl_handler':
page_alloc.c:(.text+0xbaa2): undefined reference to `sysctl_vals'
>> s390-linux-ld: page_alloc.c:(.text+0xbaae): undefined reference to `sysctl_vals'
Hi Wupeng, Thank you for the patch! Yet something to improve: [auto build test ERROR on next-20220818] url: https://github.com/intel-lab-lkp/linux/commits/Wupeng-Ma/watermark-related-improvement-on-zone-movable/20220818-170659 base: 5b6a4bf680d61b1dd26629840f848d0df8983c62 config: openrisc-buildonly-randconfig-r004-20220818 (https://download.01.org/0day-ci/archive/20220818/202208181945.AoDDCp5a-lkp@intel.com/config) compiler: or1k-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/d126658752d146244ef366f63b8edbb797dc5436 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Wupeng-Ma/watermark-related-improvement-on-zone-movable/20220818-170659 git checkout d126658752d146244ef366f63b8edbb797dc5436 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): or1k-linux-ld: or1k-linux-ld: DWARF error: could not find abbrev number 84 mm/page_alloc.o: in function `watermark_scale_factor_sysctl_handler': >> page_alloc.c:(.text+0xeaa8): undefined reference to `sysctl_vals' >> or1k-linux-ld: page_alloc.c:(.text+0xeaac): undefined reference to `sysctl_vals' `.exit.text' referenced in section `.data' of sound/soc/codecs/tlv320adc3xxx.o: defined in discarded section `.exit.text' of sound/soc/codecs/tlv320adc3xxx.o
diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index 9b833e439f09..ec240aa45322 100644 --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -1002,6 +1002,12 @@ that the number of free pages kswapd maintains for latency reasons is too small for the allocation bursts occurring in the system. This knob can then be used to tune kswapd aggressiveness accordingly. +The watermark_scale_factor is an array. You can set each zone's watermark +separately and can be seen by reading this file:: + + % cat /proc/sys/vm/watermark_scale_factor + 10 10 10 10 + zone_reclaim_mode ================= diff --git a/include/linux/mm.h b/include/linux/mm.h index 3bedc449c14d..7f1eba1541f8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2525,7 +2525,7 @@ extern void setup_per_cpu_pageset(void); /* page_alloc.c */ extern int min_free_kbytes; extern int watermark_boost_factor; -extern int watermark_scale_factor; +extern int watermark_scale_factor[MAX_NR_ZONES]; extern bool arch_has_descending_max_zone_pfns(void); /* nommu.c */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index aa712aa35744..8e6258186d3c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1173,8 +1173,8 @@ struct ctl_table; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, void *, size_t *, loff_t *); -int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, void *, - size_t *, loff_t *); +int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write, + void *buffer, size_t *length, loff_t *ppos); extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES]; int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, void *, size_t *, loff_t *); diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 205d605cacc5..d16d06c71e5a 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2251,8 +2251,6 @@ static struct ctl_table vm_table[] = { .maxlen = sizeof(watermark_scale_factor), .mode = 0644, .proc_handler = watermark_scale_factor_sysctl_handler, - .extra1 = SYSCTL_ONE, - .extra2 = SYSCTL_THREE_THOUSAND, }, { .procname = "percpu_pagelist_high_fraction", diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4f62e3d74bf2..b81dcda9f702 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -421,7 +421,6 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { int min_free_kbytes = 1024; int user_min_free_kbytes = -1; int watermark_boost_factor __read_mostly = 15000; -int watermark_scale_factor = 10; static unsigned long nr_kernel_pages __initdata; static unsigned long nr_all_pages __initdata; @@ -449,6 +448,20 @@ EXPORT_SYMBOL(nr_online_nodes); int page_group_by_mobility_disabled __read_mostly; +int watermark_scale_factor[MAX_NR_ZONES] = { +#ifdef CONFIG_ZONE_DMA + [ZONE_DMA] = 10, +#endif +#ifdef CONFIG_ZONE_DMA32 + [ZONE_DMA32] = 10, +#endif + [ZONE_NORMAL] = 10, +#ifdef CONFIG_HIGHMEM + [ZONE_HIGHMEM] = 10, +#endif + [ZONE_MOVABLE] = 10, +}; + #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT /* * During boot we initialize deferred pages on-demand, as needed, but once @@ -8643,6 +8656,7 @@ static void __setup_per_zone_wmarks(void) } for_each_zone(zone) { + int zone_wm_factor; u64 tmp; spin_lock_irqsave(&zone->lock, flags); @@ -8676,9 +8690,10 @@ static void __setup_per_zone_wmarks(void) * scale factor in proportion to available memory, but * ensure a minimum size on small systems. */ + zone_wm_factor = watermark_scale_factor[zone_idx(zone)]; tmp = max_t(u64, tmp >> 2, - mult_frac(zone_managed_pages(zone), - watermark_scale_factor, 10000)); + mult_frac(zone_managed_pages(zone), zone_wm_factor, + 10000)); zone->watermark_boost = 0; zone->_watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp; @@ -8795,14 +8810,22 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, return 0; } +/* + * watermark_scale_factor_sysctl_handler - just a wrapper around + * proc_dointvec() so that we can call setup_per_zone_wmarks() + * whenever watermark_scale_factor changes. + */ int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write, void *buffer, size_t *length, loff_t *ppos) { - int rc; + int i; - rc = proc_dointvec_minmax(table, write, buffer, length, ppos); - if (rc) - return rc; + proc_dointvec_minmax(table, write, buffer, length, ppos); + + for (i = 0; i < MAX_NR_ZONES; i++) + watermark_scale_factor[i] = + clamp(watermark_scale_factor[i], 1, + *(int *)SYSCTL_THREE_THOUSAND); if (write) setup_per_zone_wmarks();