lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2] mm: move page-writeback sysctls to is own file
On Sat, 29 Jan 2022 09:29:55 +0800 zhanglianjie <zhanglianjie@uniontech.com> wrote:

> 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.
>
> ...
>
> --- 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;

These conversions will generate warnings when CONFIG_SYSCTL=n.

mm/page-writeback.c:2002:12: warning: 'dirty_writeback_centisecs_handler' defined but not used [-Wunused-function]
2002 | static int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:545:12: warning: 'dirty_bytes_handler' defined but not used [-Wunused-function]
545 | static int dirty_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:531:12: warning: 'dirty_ratio_handler' defined but not used [-Wunused-function]
531 | static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,
| ^~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:520:12: warning: 'dirty_background_bytes_handler' defined but not used [-Wunused-function]
520 | static int dirty_background_bytes_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/page-writeback.c:509:12: warning: 'dirty_background_ratio_handler' defined but not used [-Wunused-function]
509 | static int dirty_background_ratio_handler(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm-move-page-writeback-sysctls-to-is-own-file-fix

fix CONFIG_SYSCTL=n warnings

Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: zhanglianjie <zhanglianjie@uniontech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

mm/page-writeback.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/mm/page-writeback.c~mm-move-page-writeback-sysctls-to-is-own-file-fix
+++ a/mm/page-writeback.c
@@ -506,6 +506,7 @@ bool node_dirty_ok(struct pglist_data *p
return nr_pages <= limit;
}

+#ifdef CONFIG_SYSCTL
static int dirty_background_ratio_handler(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
@@ -555,6 +556,7 @@ static int dirty_bytes_handler(struct ct
}
return ret;
}
+#endif

static unsigned long wp_next_time(unsigned long cur_time)
{
@@ -1996,6 +1998,7 @@ bool wb_over_bg_thresh(struct bdi_writeb
return false;
}

+#ifdef CONFIG_SYSCTL
/*
* sysctl handler for /proc/sys/vm/dirty_writeback_centisecs
*/
@@ -2020,6 +2023,7 @@ static int dirty_writeback_centisecs_han

return ret;
}
+#endif

void laptop_mode_timer_fn(struct timer_list *t)
{
_
\
 
 \ /
  Last update: 2022-02-01 00:24    [W:0.036 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site