lkml.org 
[lkml]   [2021]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] mm/compaction: remove unused variable sysctl_compact_memory
From
Date
On 3/4/21 11:03 AM, Pintu Kumar wrote:
> The sysctl_compact_memory is mostly unused in mm/compaction.c
> It just acts as a place holder for sysctl to store .data.
>
> But the .data itself is not needed here.
> So we can get ride of this variable completely and make .data as NULL.
> This will also eliminate the extern declaration from header file.
> No functionality is broken or changed this way.
>
> Signed-off-by: Pintu Kumar <pintu@codeaurora.org>
> Signed-off-by: Pintu Agarwal <pintu.ping@gmail.com>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
> v2: completely get rid of this variable and set .data to NULL
> Suggested-by: Vlastimil Babka <vbabka@suse.cz>
>
> include/linux/compaction.h | 1 -
> kernel/sysctl.c | 2 +-
> mm/compaction.c | 3 ---
> 3 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
> index ed4070e..4221888 100644
> --- a/include/linux/compaction.h
> +++ b/include/linux/compaction.h
> @@ -81,7 +81,6 @@ static inline unsigned long compact_gap(unsigned int order)
> }
>
> #ifdef CONFIG_COMPACTION
> -extern int sysctl_compact_memory;
> extern unsigned int sysctl_compaction_proactiveness;
> extern int sysctl_compaction_handler(struct ctl_table *table, int write,
> void *buffer, size_t *length, loff_t *ppos);
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index c9fbdd8..07ef240 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2856,7 +2856,7 @@ static struct ctl_table vm_table[] = {
> #ifdef CONFIG_COMPACTION
> {
> .procname = "compact_memory",
> - .data = &sysctl_compact_memory,
> + .data = NULL,
> .maxlen = sizeof(int),
> .mode = 0200,
> .proc_handler = sysctl_compaction_handler,
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 190ccda..ede2886 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -2650,9 +2650,6 @@ static void compact_nodes(void)
> compact_node(nid);
> }
>
> -/* The written value is actually unused, all memory is compacted */
> -int sysctl_compact_memory;
> -
> /*
> * Tunable for proactive compaction. It determines how
> * aggressively the kernel should compact memory in the
>

\
 
 \ /
  Last update: 2021-03-04 12:03    [W:0.058 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site