]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/compaction: remove unused variable sysctl_compact_memory
authorPintu Kumar <pintu@codeaurora.org>
Wed, 5 May 2021 01:36:48 +0000 (18:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 18:27:24 +0000 (11:27 -0700)
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.

Link: https://lkml.kernel.org/r/1614852224-14671-1-git-send-email-pintu@codeaurora.org
Signed-off-by: Pintu Kumar <pintu@codeaurora.org>
Signed-off-by: Pintu Agarwal <pintu.ping@gmail.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/compaction.h
kernel/sysctl.c
mm/compaction.c

index ed4070ed41ef5755cc278b8884bd1c9d27113aa0..4221888bdcd656b72f196d457505ad678bfd7ffb 100644 (file)
@@ -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);
index f91d327273c1b3a05668369e2b42da4cc9143382..14edf84cc571f5c19b8eec330719e3f36807f19a 100644 (file)
@@ -2830,7 +2830,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,
index 335862f1661c17e0db135e672f56ec887deb8c00..027eb794e747f5efa3c7b243bf4bf8b828209e52 100644 (file)
@@ -2692,9 +2692,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