2022-01-30 19:30:54

by Lianjie Zhang

[permalink] [raw]
Subject: [PATCH] mm: move page-writeback sysctls to is own file

kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
dishes, this makes it very difficult to maintain.

To help with this maintenance let's start by moving sysctls to places
where they actually belong. The proc sysctl maintainers do not want to
know what sysctl knobs you wish to add for your own piece of code, we
just care about the core logic.

So move the page-writeback sysctls to its own file.

Signed-off-by: zhanglianjie <[email protected]>

diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index fec248ab1fec..dc2b94e6a94f 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -345,28 +345,13 @@ void wb_domain_exit(struct wb_domain *dom);
extern struct wb_domain global_wb_domain;

/* These are exported to sysctl. */
-extern int dirty_background_ratio;
-extern unsigned long dirty_background_bytes;
-extern int vm_dirty_ratio;
-extern unsigned long vm_dirty_bytes;
extern unsigned int dirty_writeback_interval;
extern unsigned int dirty_expire_interval;
extern unsigned int dirtytime_expire_interval;
-extern int vm_highmem_is_dirtyable;
extern int laptop_mode;

-int dirty_background_ratio_handler(struct ctl_table *table, int write,
- void *buffer, size_t *lenp, loff_t *ppos);
-int dirty_background_bytes_handler(struct ctl_table *table, int write,
- void *buffer, size_t *lenp, loff_t *ppos);
-int dirty_ratio_handler(struct ctl_table *table, int write,
- void *buffer, size_t *lenp, loff_t *ppos);
-int dirty_bytes_handler(struct ctl_table *table, int write,
- void *buffer, size_t *lenp, loff_t *ppos);
int dirtytime_interval_handler(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos);
-int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
- void *buffer, size_t *lenp, loff_t *ppos);

void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 5ae443b2882e..34371bcb8ffa 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -100,8 +100,6 @@
static const int six_hundred_forty_kb = 640 * 1024;
#endif

-/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
-static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;

static const int ngroups_max = NGROUPS_MAX;
static const int cap_last_cap = CAP_LAST_CAP;
@@ -2401,55 +2399,6 @@ static struct ctl_table vm_table[] = {
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
},
- {
- .procname = "dirty_background_ratio",
- .data = &dirty_background_ratio,
- .maxlen = sizeof(dirty_background_ratio),
- .mode = 0644,
- .proc_handler = dirty_background_ratio_handler,
- .extra1 = SYSCTL_ZERO,
- .extra2 = SYSCTL_ONE_HUNDRED,
- },
- {
- .procname = "dirty_background_bytes",
- .data = &dirty_background_bytes,
- .maxlen = sizeof(dirty_background_bytes),
- .mode = 0644,
- .proc_handler = dirty_background_bytes_handler,
- .extra1 = SYSCTL_LONG_ONE,
- },
- {
- .procname = "dirty_ratio",
- .data = &vm_dirty_ratio,
- .maxlen = sizeof(vm_dirty_ratio),
- .mode = 0644,
- .proc_handler = dirty_ratio_handler,
- .extra1 = SYSCTL_ZERO,
- .extra2 = SYSCTL_ONE_HUNDRED,
- },
- {
- .procname = "dirty_bytes",
- .data = &vm_dirty_bytes,
- .maxlen = sizeof(vm_dirty_bytes),
- .mode = 0644,
- .proc_handler = dirty_bytes_handler,
- .extra1 = (void *)&dirty_bytes_min,
- },
- {
- .procname = "dirty_writeback_centisecs",
- .data = &dirty_writeback_interval,
- .maxlen = sizeof(dirty_writeback_interval),
- .mode = 0644,
- .proc_handler = dirty_writeback_centisecs_handler,
- },
- {
- .procname = "dirty_expire_centisecs",
- .data = &dirty_expire_interval,
- .maxlen = sizeof(dirty_expire_interval),
- .mode = 0644,
- .proc_handler = proc_dointvec_minmax,
- .extra1 = SYSCTL_ZERO,
- },
{
.procname = "dirtytime_expire_seconds",
.data = &dirtytime_expire_interval,
@@ -2621,13 +2570,6 @@ static struct ctl_table vm_table[] = {
.extra1 = SYSCTL_ZERO,
},
#endif
- {
- .procname = "laptop_mode",
- .data = &laptop_mode,
- .maxlen = sizeof(laptop_mode),
- .mode = 0644,
- .proc_handler = proc_dointvec_jiffies,
- },
{
.procname = "vfs_cache_pressure",
.data = &sysctl_vfs_cache_pressure,
@@ -2725,17 +2667,6 @@ static struct ctl_table vm_table[] = {
.extra1 = SYSCTL_ZERO,
},
#endif
-#ifdef CONFIG_HIGHMEM
- {
- .procname = "highmem_is_dirtyable",
- .data = &vm_highmem_is_dirtyable,
- .maxlen = sizeof(vm_highmem_is_dirtyable),
- .mode = 0644,
- .proc_handler = proc_dointvec_minmax,
- .extra1 = SYSCTL_ZERO,
- .extra2 = SYSCTL_ONE,
- },
-#endif
#ifdef CONFIG_MEMORY_FAILURE
{
.procname = "memory_failure_early_kill",
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 91d163f8d36b..9ffe81ec08b9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -70,30 +70,33 @@ static long ratelimit_pages = 32;
/*
* Start background writeback (via writeback threads) at this percentage
*/
-int dirty_background_ratio = 10;
+static int dirty_background_ratio = 10;

/*
* dirty_background_bytes starts at 0 (disabled) so that it is a function of
* dirty_background_ratio * the amount of dirtyable memory
*/
-unsigned long dirty_background_bytes;
+static unsigned long dirty_background_bytes;

/*
* free highmem will not be subtracted from the total free memory
* for calculating free ratios if vm_highmem_is_dirtyable is true
*/
-int vm_highmem_is_dirtyable;
+static int vm_highmem_is_dirtyable;

/*
* The generator of dirty data starts writeback at this percentage
*/
-int vm_dirty_ratio = 20;
+static int vm_dirty_ratio = 20;
+
+/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
+static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;

/*
* vm_dirty_bytes starts at 0 (disabled) so that it is a function of
* vm_dirty_ratio * the amount of dirtyable memory
*/
-unsigned long vm_dirty_bytes;
+static unsigned long vm_dirty_bytes;

/*
* The interval between `kupdate'-style writebacks
@@ -2081,6 +2084,79 @@ static int page_writeback_cpu_online(unsigned int cpu)
return 0;
}

+#ifdef CONFIG_SYSCTL
+static struct ctl_table vm_page_writeback_sysctls[] = {
+ {
+ .procname = "dirty_background_ratio",
+ .data = &dirty_background_ratio,
+ .maxlen = sizeof(dirty_background_ratio),
+ .mode = 0644,
+ .proc_handler = dirty_background_ratio_handler,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE_HUNDRED,
+ },
+ {
+ .procname = "dirty_background_bytes",
+ .data = &dirty_background_bytes,
+ .maxlen = sizeof(dirty_background_bytes),
+ .mode = 0644,
+ .proc_handler = dirty_background_bytes_handler,
+ .extra1 = SYSCTL_LONG_ONE,
+ },
+ {
+ .procname = "dirty_ratio",
+ .data = &vm_dirty_ratio,
+ .maxlen = sizeof(vm_dirty_ratio),
+ .mode = 0644,
+ .proc_handler = dirty_ratio_handler,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE_HUNDRED,
+ },
+ {
+ .procname = "dirty_bytes",
+ .data = &vm_dirty_bytes,
+ .maxlen = sizeof(vm_dirty_bytes),
+ .mode = 0644,
+ .proc_handler = dirty_bytes_handler,
+ .extra1 = (void *)&dirty_bytes_min,
+ },
+ {
+ .procname = "dirty_writeback_centisecs",
+ .data = &dirty_writeback_interval,
+ .maxlen = sizeof(dirty_writeback_interval),
+ .mode = 0644,
+ .proc_handler = dirty_writeback_centisecs_handler,
+ },
+ {
+ .procname = "dirty_expire_centisecs",
+ .data = &dirty_expire_interval,
+ .maxlen = sizeof(dirty_expire_interval),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ },
+#ifdef CONFIG_HIGHMEM
+ {
+ .procname = "highmem_is_dirtyable",
+ .data = &vm_highmem_is_dirtyable,
+ .maxlen = sizeof(vm_highmem_is_dirtyable),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ONE,
+ },
+#endif
+ {
+ .procname = "laptop_mode",
+ .data = &laptop_mode,
+ .maxlen = sizeof(laptop_mode),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_jiffies,
+ },
+ {}
+};
+#endif
+
/*
* Called early on to tune the page writeback dirty limits.
*
@@ -2105,6 +2181,9 @@ void __init page_writeback_init(void)
page_writeback_cpu_online, NULL);
cpuhp_setup_state(CPUHP_MM_WRITEBACK_DEAD, "mm/writeback:dead", NULL,
page_writeback_cpu_online);
+#ifdef CONFIG_SYSCTL
+ register_sysctl_init("vm", vm_page_writeback_sysctls);
+#endif
}

/**
--
2.20.1




2022-01-31 11:22:28

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mm: move page-writeback sysctls to is own file

Hi zhanglianjie,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc1 next-20220128]
[cannot apply to hnaz-mm/master linux/master kees/for-next/pstore]
[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/zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23a46422c56144939c091c76cf389aa863ce9c18
config: arm64-buildonly-randconfig-r005-20220127 (https://download.01.org/0day-ci/archive/20220129/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/d24502aa729978894feb2de10481cd139ae5bb42
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
git checkout d24502aa729978894feb2de10481cd139ae5bb42
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

mm/page-writeback.c:509:5: warning: no previous prototype for function 'dirty_background_ratio_handler' [-Wmissing-prototypes]
int dirty_background_ratio_handler(struct ctl_table *table, int write,
^
mm/page-writeback.c:509:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dirty_background_ratio_handler(struct ctl_table *table, int write,
^
static
mm/page-writeback.c:520:5: warning: no previous prototype for function 'dirty_background_bytes_handler' [-Wmissing-prototypes]
int dirty_background_bytes_handler(struct ctl_table *table, int write,
^
mm/page-writeback.c:520:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dirty_background_bytes_handler(struct ctl_table *table, int write,
^
static
mm/page-writeback.c:531:5: warning: no previous prototype for function 'dirty_ratio_handler' [-Wmissing-prototypes]
int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
^
mm/page-writeback.c:531:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
^
static
mm/page-writeback.c:545:5: warning: no previous prototype for function 'dirty_bytes_handler' [-Wmissing-prototypes]
int dirty_bytes_handler(struct ctl_table *table, int write,
^
mm/page-writeback.c:545:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dirty_bytes_handler(struct ctl_table *table, int write,
^
static
mm/page-writeback.c:2002:5: warning: no previous prototype for function 'dirty_writeback_centisecs_handler' [-Wmissing-prototypes]
int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
^
mm/page-writeback.c:2002:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
^
static
>> mm/page-writeback.c:93:28: warning: unused variable 'dirty_bytes_min' [-Wunused-const-variable]
static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
^
6 warnings generated.


vim +/dirty_bytes_min +93 mm/page-writeback.c

91
92 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
> 93 static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
94

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-01-31 11:22:52

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mm: move page-writeback sysctls to is own file

Hi zhanglianjie,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc1 next-20220128]
[cannot apply to hnaz-mm/master linux/master kees/for-next/pstore]
[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/zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23a46422c56144939c091c76cf389aa863ce9c18
config: i386-randconfig-a003 (https://download.01.org/0day-ci/archive/20220129/[email protected]/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/d24502aa729978894feb2de10481cd139ae5bb42
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
git checkout d24502aa729978894feb2de10481cd139ae5bb42
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> mm/page-writeback.c:509:5: warning: no previous prototype for 'dirty_background_ratio_handler' [-Wmissing-prototypes]
509 | int dirty_background_ratio_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/page-writeback.c:520:5: warning: no previous prototype for 'dirty_background_bytes_handler' [-Wmissing-prototypes]
520 | int dirty_background_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/page-writeback.c:531:5: warning: no previous prototype for 'dirty_ratio_handler' [-Wmissing-prototypes]
531 | int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
| ^~~~~~~~~~~~~~~~~~~
>> mm/page-writeback.c:545:5: warning: no previous prototype for 'dirty_bytes_handler' [-Wmissing-prototypes]
545 | int dirty_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~
>> mm/page-writeback.c:2002:5: warning: no previous prototype for 'dirty_writeback_centisecs_handler' [-Wmissing-prototypes]
2002 | int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/dirty_background_ratio_handler +509 mm/page-writeback.c

a756cf5908530e Johannes Weiner 2012-01-10 508
2da02997e08d3e David Rientjes 2009-01-06 @509 int dirty_background_ratio_handler(struct ctl_table *table, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24 510 void *buffer, size_t *lenp, loff_t *ppos)
2da02997e08d3e David Rientjes 2009-01-06 511 {
2da02997e08d3e David Rientjes 2009-01-06 512 int ret;
2da02997e08d3e David Rientjes 2009-01-06 513
8d65af789f3e2c Alexey Dobriyan 2009-09-23 514 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2da02997e08d3e David Rientjes 2009-01-06 515 if (ret == 0 && write)
2da02997e08d3e David Rientjes 2009-01-06 516 dirty_background_bytes = 0;
2da02997e08d3e David Rientjes 2009-01-06 517 return ret;
2da02997e08d3e David Rientjes 2009-01-06 518 }
2da02997e08d3e David Rientjes 2009-01-06 519
2da02997e08d3e David Rientjes 2009-01-06 @520 int dirty_background_bytes_handler(struct ctl_table *table, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24 521 void *buffer, size_t *lenp, loff_t *ppos)
2da02997e08d3e David Rientjes 2009-01-06 522 {
2da02997e08d3e David Rientjes 2009-01-06 523 int ret;
2da02997e08d3e David Rientjes 2009-01-06 524
8d65af789f3e2c Alexey Dobriyan 2009-09-23 525 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
2da02997e08d3e David Rientjes 2009-01-06 526 if (ret == 0 && write)
2da02997e08d3e David Rientjes 2009-01-06 527 dirty_background_ratio = 0;
2da02997e08d3e David Rientjes 2009-01-06 528 return ret;
2da02997e08d3e David Rientjes 2009-01-06 529 }
2da02997e08d3e David Rientjes 2009-01-06 530
32927393dc1ccd Christoph Hellwig 2020-04-24 @531 int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
32927393dc1ccd Christoph Hellwig 2020-04-24 532 size_t *lenp, loff_t *ppos)
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 533 {
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 534 int old_ratio = vm_dirty_ratio;
2da02997e08d3e David Rientjes 2009-01-06 535 int ret;
2da02997e08d3e David Rientjes 2009-01-06 536
8d65af789f3e2c Alexey Dobriyan 2009-09-23 537 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 538 if (ret == 0 && write && vm_dirty_ratio != old_ratio) {
eb608e3a344b3a Jan Kara 2012-05-24 539 writeback_set_ratelimit();
2da02997e08d3e David Rientjes 2009-01-06 540 vm_dirty_bytes = 0;
2da02997e08d3e David Rientjes 2009-01-06 541 }
2da02997e08d3e David Rientjes 2009-01-06 542 return ret;
2da02997e08d3e David Rientjes 2009-01-06 543 }
2da02997e08d3e David Rientjes 2009-01-06 544
2da02997e08d3e David Rientjes 2009-01-06 @545 int dirty_bytes_handler(struct ctl_table *table, int write,
32927393dc1ccd Christoph Hellwig 2020-04-24 546 void *buffer, size_t *lenp, loff_t *ppos)
2da02997e08d3e David Rientjes 2009-01-06 547 {
fc3501d411d348 Sven Wegener 2009-02-11 548 unsigned long old_bytes = vm_dirty_bytes;
2da02997e08d3e David Rientjes 2009-01-06 549 int ret;
2da02997e08d3e David Rientjes 2009-01-06 550
8d65af789f3e2c Alexey Dobriyan 2009-09-23 551 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
2da02997e08d3e David Rientjes 2009-01-06 552 if (ret == 0 && write && vm_dirty_bytes != old_bytes) {
eb608e3a344b3a Jan Kara 2012-05-24 553 writeback_set_ratelimit();
2da02997e08d3e David Rientjes 2009-01-06 554 vm_dirty_ratio = 0;
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 555 }
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 556 return ret;
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 557 }
04fbfdc14e5f48 Peter Zijlstra 2007-10-16 558

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-02-02 10:35:42

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH] mm: move page-writeback sysctls to is own file

Likewise here, these test results are assuming an older kernel. Instead
linux-next can be a better target to test for for these patches.

Luis

On Sat, Jan 29, 2022 at 01:16:53AM +0800, kernel test robot wrote:
> Hi zhanglianjie,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on linus/master]
> [also build test WARNING on v5.17-rc1 next-20220128]
> [cannot apply to hnaz-mm/master linux/master kees/for-next/pstore]
> [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/zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
> base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 23a46422c56144939c091c76cf389aa863ce9c18
> config: i386-randconfig-a003 (https://download.01.org/0day-ci/archive/20220129/[email protected]/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/d24502aa729978894feb2de10481cd139ae5bb42
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review zhanglianjie/mm-move-page-writeback-sysctls-to-is-own-file/20220128-172052
> git checkout d24502aa729978894feb2de10481cd139ae5bb42
> # save the config file to linux build tree
> mkdir build_dir
> make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All warnings (new ones prefixed by >>):
>
> >> mm/page-writeback.c:509:5: warning: no previous prototype for 'dirty_background_ratio_handler' [-Wmissing-prototypes]
> 509 | int dirty_background_ratio_handler(struct ctl_table *table, int write,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> mm/page-writeback.c:520:5: warning: no previous prototype for 'dirty_background_bytes_handler' [-Wmissing-prototypes]
> 520 | int dirty_background_bytes_handler(struct ctl_table *table, int write,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> mm/page-writeback.c:531:5: warning: no previous prototype for 'dirty_ratio_handler' [-Wmissing-prototypes]
> 531 | int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
> | ^~~~~~~~~~~~~~~~~~~
> >> mm/page-writeback.c:545:5: warning: no previous prototype for 'dirty_bytes_handler' [-Wmissing-prototypes]
> 545 | int dirty_bytes_handler(struct ctl_table *table, int write,
> | ^~~~~~~~~~~~~~~~~~~
> >> mm/page-writeback.c:2002:5: warning: no previous prototype for 'dirty_writeback_centisecs_handler' [-Wmissing-prototypes]
> 2002 | int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> vim +/dirty_background_ratio_handler +509 mm/page-writeback.c
>
> a756cf5908530e Johannes Weiner 2012-01-10 508
> 2da02997e08d3e David Rientjes 2009-01-06 @509 int dirty_background_ratio_handler(struct ctl_table *table, int write,
> 32927393dc1ccd Christoph Hellwig 2020-04-24 510 void *buffer, size_t *lenp, loff_t *ppos)
> 2da02997e08d3e David Rientjes 2009-01-06 511 {
> 2da02997e08d3e David Rientjes 2009-01-06 512 int ret;
> 2da02997e08d3e David Rientjes 2009-01-06 513
> 8d65af789f3e2c Alexey Dobriyan 2009-09-23 514 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
> 2da02997e08d3e David Rientjes 2009-01-06 515 if (ret == 0 && write)
> 2da02997e08d3e David Rientjes 2009-01-06 516 dirty_background_bytes = 0;
> 2da02997e08d3e David Rientjes 2009-01-06 517 return ret;
> 2da02997e08d3e David Rientjes 2009-01-06 518 }
> 2da02997e08d3e David Rientjes 2009-01-06 519
> 2da02997e08d3e David Rientjes 2009-01-06 @520 int dirty_background_bytes_handler(struct ctl_table *table, int write,
> 32927393dc1ccd Christoph Hellwig 2020-04-24 521 void *buffer, size_t *lenp, loff_t *ppos)
> 2da02997e08d3e David Rientjes 2009-01-06 522 {
> 2da02997e08d3e David Rientjes 2009-01-06 523 int ret;
> 2da02997e08d3e David Rientjes 2009-01-06 524
> 8d65af789f3e2c Alexey Dobriyan 2009-09-23 525 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
> 2da02997e08d3e David Rientjes 2009-01-06 526 if (ret == 0 && write)
> 2da02997e08d3e David Rientjes 2009-01-06 527 dirty_background_ratio = 0;
> 2da02997e08d3e David Rientjes 2009-01-06 528 return ret;
> 2da02997e08d3e David Rientjes 2009-01-06 529 }
> 2da02997e08d3e David Rientjes 2009-01-06 530
> 32927393dc1ccd Christoph Hellwig 2020-04-24 @531 int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
> 32927393dc1ccd Christoph Hellwig 2020-04-24 532 size_t *lenp, loff_t *ppos)
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 533 {
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 534 int old_ratio = vm_dirty_ratio;
> 2da02997e08d3e David Rientjes 2009-01-06 535 int ret;
> 2da02997e08d3e David Rientjes 2009-01-06 536
> 8d65af789f3e2c Alexey Dobriyan 2009-09-23 537 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 538 if (ret == 0 && write && vm_dirty_ratio != old_ratio) {
> eb608e3a344b3a Jan Kara 2012-05-24 539 writeback_set_ratelimit();
> 2da02997e08d3e David Rientjes 2009-01-06 540 vm_dirty_bytes = 0;
> 2da02997e08d3e David Rientjes 2009-01-06 541 }
> 2da02997e08d3e David Rientjes 2009-01-06 542 return ret;
> 2da02997e08d3e David Rientjes 2009-01-06 543 }
> 2da02997e08d3e David Rientjes 2009-01-06 544
> 2da02997e08d3e David Rientjes 2009-01-06 @545 int dirty_bytes_handler(struct ctl_table *table, int write,
> 32927393dc1ccd Christoph Hellwig 2020-04-24 546 void *buffer, size_t *lenp, loff_t *ppos)
> 2da02997e08d3e David Rientjes 2009-01-06 547 {
> fc3501d411d348 Sven Wegener 2009-02-11 548 unsigned long old_bytes = vm_dirty_bytes;
> 2da02997e08d3e David Rientjes 2009-01-06 549 int ret;
> 2da02997e08d3e David Rientjes 2009-01-06 550
> 8d65af789f3e2c Alexey Dobriyan 2009-09-23 551 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
> 2da02997e08d3e David Rientjes 2009-01-06 552 if (ret == 0 && write && vm_dirty_bytes != old_bytes) {
> eb608e3a344b3a Jan Kara 2012-05-24 553 writeback_set_ratelimit();
> 2da02997e08d3e David Rientjes 2009-01-06 554 vm_dirty_ratio = 0;
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 555 }
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 556 return ret;
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 557 }
> 04fbfdc14e5f48 Peter Zijlstra 2007-10-16 558
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]