Skip to contentSkip to conversation

mm: introduce cache_reclaim_weight

PATCH In review Xishi Qiu 1 participant 1 message Jun 16, 2014

Subsystems (5)
lore
Share & tools
lore

Xishi Qiu

author
#0 lore raw

PATCH 6/8 mm: introduce cache_reclaim_weight

This patch introduces a parameters cache_reclaim_weight. It is used to speed up page cache reclaim.

---
 include/linux/swap.h |    3 +++
 kernel/sysctl.c      |    9 +++++++++
 mm/vmscan.c          |    6 ++++++
 3 files changed, 18 insertions(+), 0 deletions(-)
include/linux/swap.h +3 -0
index bd85493..db912b2 100644
@@ -361,6 +361,9 @@ extern unsigned long vm_cache_limit_mbytes_min;
 extern unsigned long vm_cache_limit_mbytes_max;
 extern unsigned long vm_cache_reclaim_s;
 extern unsigned long vm_cache_reclaim_s_min;
+extern unsigned long vm_cache_reclaim_weight;
+extern unsigned long vm_cache_reclaim_weight_min;
+extern unsigned long vm_cache_reclaim_weight_max;
 extern int cache_limit_ratio_sysctl_handler(struct ctl_table *table, int write,
 			void __user *buffer, size_t *length, loff_t *ppos);
 extern int cache_limit_mbytes_sysctl_handler(struct ctl_table *table, int write,
kernel/sysctl.c +9 -0
index a8a09c4..452e0d3 100644
@@ -1298,6 +1298,15 @@ static struct ctl_table vm_table[] = {
 		.proc_handler	= proc_doulongvec_minmax,
 		.extra1		= &vm_cache_reclaim_s_min,
 	},
+	{
+		.procname	= "cache_reclaim_weight",
+		.data		= &vm_cache_reclaim_weight,
+		.maxlen		= sizeof(vm_cache_reclaim_weight),
+		.mode		= 0644,
+		.proc_handler	= proc_doulongvec_minmax,
+		.extra1		= &vm_cache_reclaim_weight_min,
+		.extra2		= &vm_cache_reclaim_weight_max,
+	},
 #ifdef CONFIG_COMPACTION
 	{
 		.procname	= "compact_memory",
mm/vmscan.c +6 -0
index d7f866e..d179be6 100644
@@ -139,6 +139,9 @@ unsigned long vm_cache_limit_mbytes_min;
 unsigned long vm_cache_limit_mbytes_max;
 unsigned long vm_cache_reclaim_s __read_mostly;
 unsigned long vm_cache_reclaim_s_min;
+unsigned long vm_cache_reclaim_weight __read_mostly;
+unsigned long vm_cache_reclaim_weight_min;
+unsigned long vm_cache_reclaim_weight_max;
 
 static DEFINE_PER_CPU(struct delayed_work, vmscan_work);
 static LIST_HEAD(shrinker_list);
@@ -3410,6 +3413,9 @@ static void shrink_page_cache_init(void)
 	vm_cache_limit_mbytes_max = totalram_pages;
 	vm_cache_reclaim_s = 0;
 	vm_cache_reclaim_s_min = 0;
+	vm_cache_reclaim_weight = 1;
+	vm_cache_reclaim_weight_min = 1;
+	vm_cache_reclaim_weight_max = 100;
 
 	for_each_online_cpu(cpu) {
 		struct delayed_work *work = &per_cpu(vmscan_work, cpu);
Signature · 1 line
1.6.0.2