linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/compaction: remove unused variable sysctl_compact_memory
@ 2021-03-02 17:56 Pintu Kumar
  2021-03-02 20:18 ` Nitin Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Pintu Kumar @ 2021-03-02 17:56 UTC (permalink / raw)
  To: linux-kernel, akpm, linux-mm, linux-fsdevel, pintu,
	iamjoonsoo.kim, sh_def, mateusznosek0, bhe, nigupta, vbabka,
	yzaikin, keescook, mcgrof, mgorman
  Cc: pintu.ping

The sysctl_compact_memory is mostly unsed in mm/compaction.c
It just acts as a place holder for sysctl.

Thus we can remove it from here and move the declaration directly
in kernel/sysctl.c itself.
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>
---
 include/linux/compaction.h | 1 -
 kernel/sysctl.c            | 1 +
 mm/compaction.c            | 3 ---
 3 files changed, 1 insertion(+), 4 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..66aff21 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -198,6 +198,7 @@ static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
 #ifdef CONFIG_COMPACTION
 static int min_extfrag_threshold;
 static int max_extfrag_threshold = 1000;
+static int sysctl_compact_memory;
 #endif
 
 #endif /* CONFIG_SYSCTL */
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
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-04 10:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 17:56 [PATCH] mm/compaction: remove unused variable sysctl_compact_memory Pintu Kumar
2021-03-02 20:18 ` Nitin Gupta
2021-03-03 14:33   ` pintu
2021-03-03 18:14     ` Nitin Gupta
2021-03-03  6:57 ` Chaitanya Kulkarni
2021-03-03 17:09 ` Vlastimil Babka
2021-03-03 17:47   ` pintu
2021-03-04 10:03     ` [PATCH v2] " Pintu Kumar
2021-03-04 10:57       ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).