All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20170919072342.GB7263@intel.com>

diff --git a/a/2.txt b/N1/2.txt
index 8b13789..c719d0f 100644
--- a/a/2.txt
+++ b/N1/2.txt
@@ -1 +1,119 @@
+>From e3c9516beb8302cb8fb2f5ab866bbe2686fda5fb Mon Sep 17 00:00:00 2001
+From: Aaron Lu <aaron.lu@intel.com>
+Date: Thu, 6 Jul 2017 15:00:07 +0800
+Subject: [PATCH] percpu_pagelist_batch: add a batch interface
 
+Signed-off-by: Aaron Lu <aaron.lu@intel.com>
+---
+ include/linux/mmzone.h |  2 ++
+ kernel/sysctl.c        |  9 +++++++++
+ mm/page_alloc.c        | 40 +++++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 50 insertions(+), 1 deletion(-)
+
+diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
+index ef6a13b7bd3e..0548d038b7cd 100644
+--- a/include/linux/mmzone.h
++++ b/include/linux/mmzone.h
+@@ -875,6 +875,8 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
+ 					void __user *, size_t *, loff_t *);
+ int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,
+ 					void __user *, size_t *, loff_t *);
++int percpu_pagelist_batch_sysctl_handler(struct ctl_table *, int,
++					void __user *, size_t *, loff_t *);
+ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
+ 			void __user *, size_t *, loff_t *);
+ int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c
+index 4dfba1a76cc3..85cc4544db1b 100644
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
+@@ -108,6 +108,7 @@ extern unsigned int core_pipe_limit;
+ extern int pid_max;
+ extern int pid_max_min, pid_max_max;
+ extern int percpu_pagelist_fraction;
++extern int percpu_pagelist_batch;
+ extern int latencytop_enabled;
+ extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
+ #ifndef CONFIG_MMU
+@@ -1440,6 +1441,14 @@ static struct ctl_table vm_table[] = {
+ 		.proc_handler	= percpu_pagelist_fraction_sysctl_handler,
+ 		.extra1		= &zero,
+ 	},
++	{
++		.procname	= "percpu_pagelist_batch",
++		.data		= &percpu_pagelist_batch,
++		.maxlen		= sizeof(percpu_pagelist_batch),
++		.mode		= 0644,
++		.proc_handler	= percpu_pagelist_batch_sysctl_handler,
++		.extra1		= &zero,
++	},
+ #ifdef CONFIG_MMU
+ 	{
+ 		.procname	= "max_map_count",
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 2302f250d6b1..aa96a4bd6467 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -129,6 +129,7 @@ unsigned long totalreserve_pages __read_mostly;
+ unsigned long totalcma_pages __read_mostly;
+ 
+ int percpu_pagelist_fraction;
++int percpu_pagelist_batch;
+ gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
+ 
+ /*
+@@ -5477,7 +5478,8 @@ static void pageset_set_high_and_batch(struct zone *zone,
+ 			(zone->managed_pages /
+ 				percpu_pagelist_fraction));
+ 	else
+-		pageset_set_batch(pcp, zone_batchsize(zone));
++		pageset_set_batch(pcp, percpu_pagelist_batch ?
++				percpu_pagelist_batch : zone_batchsize(zone));
+ }
+ 
+ static void __meminit zone_pageset_init(struct zone *zone, int cpu)
+@@ -7157,6 +7159,42 @@ int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *table, int write,
+ 	return ret;
+ }
+ 
++int percpu_pagelist_batch_sysctl_handler(struct ctl_table *table, int write,
++	void __user *buffer, size_t *length, loff_t *ppos)
++{
++	struct zone *zone;
++	int old_percpu_pagelist_batch;
++	int ret;
++
++	mutex_lock(&pcp_batch_high_lock);
++	old_percpu_pagelist_batch = percpu_pagelist_batch;
++
++	ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
++	if (!write || ret < 0)
++		goto out;
++
++	/* Sanity checking to avoid pcp imbalance */
++	if (percpu_pagelist_batch <= 0) {
++		ret = -EINVAL;
++		goto out;
++	}
++
++	/* No change? */
++	if (percpu_pagelist_batch == old_percpu_pagelist_batch)
++		goto out;
++
++	for_each_populated_zone(zone) {
++		unsigned int cpu;
++
++		for_each_possible_cpu(cpu)
++			pageset_set_high_and_batch(zone,
++					per_cpu_ptr(zone->pageset, cpu));
++	}
++out:
++	mutex_unlock(&pcp_batch_high_lock);
++	return ret;
++}
++
+ #ifdef CONFIG_NUMA
+ int hashdist = HASHDIST_DEFAULT;
+ 
+-- 
+2.9.5
diff --git a/a/content_digest b/N1/content_digest
index 7d0c64d..badc47d 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -100,5 +100,124 @@
  "\01:2\0"
  "fn\00001-percpu_pagelist_batch-add-a-batch-interface.patch\0"
  "b\0"
+ ">From e3c9516beb8302cb8fb2f5ab866bbe2686fda5fb Mon Sep 17 00:00:00 2001\n"
+ "From: Aaron Lu <aaron.lu@intel.com>\n"
+ "Date: Thu, 6 Jul 2017 15:00:07 +0800\n"
+ "Subject: [PATCH] percpu_pagelist_batch: add a batch interface\n"
+ "\n"
+ "Signed-off-by: Aaron Lu <aaron.lu@intel.com>\n"
+ "---\n"
+ " include/linux/mmzone.h |  2 ++\n"
+ " kernel/sysctl.c        |  9 +++++++++\n"
+ " mm/page_alloc.c        | 40 +++++++++++++++++++++++++++++++++++++++-\n"
+ " 3 files changed, 50 insertions(+), 1 deletion(-)\n"
+ "\n"
+ "diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h\n"
+ "index ef6a13b7bd3e..0548d038b7cd 100644\n"
+ "--- a/include/linux/mmzone.h\n"
+ "+++ b/include/linux/mmzone.h\n"
+ "@@ -875,6 +875,8 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,\n"
+ " \t\t\t\t\tvoid __user *, size_t *, loff_t *);\n"
+ " int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int,\n"
+ " \t\t\t\t\tvoid __user *, size_t *, loff_t *);\n"
+ "+int percpu_pagelist_batch_sysctl_handler(struct ctl_table *, int,\n"
+ "+\t\t\t\t\tvoid __user *, size_t *, loff_t *);\n"
+ " int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,\n"
+ " \t\t\tvoid __user *, size_t *, loff_t *);\n"
+ " int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,\n"
+ "diff --git a/kernel/sysctl.c b/kernel/sysctl.c\n"
+ "index 4dfba1a76cc3..85cc4544db1b 100644\n"
+ "--- a/kernel/sysctl.c\n"
+ "+++ b/kernel/sysctl.c\n"
+ "@@ -108,6 +108,7 @@ extern unsigned int core_pipe_limit;\n"
+ " extern int pid_max;\n"
+ " extern int pid_max_min, pid_max_max;\n"
+ " extern int percpu_pagelist_fraction;\n"
+ "+extern int percpu_pagelist_batch;\n"
+ " extern int latencytop_enabled;\n"
+ " extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;\n"
+ " #ifndef CONFIG_MMU\n"
+ "@@ -1440,6 +1441,14 @@ static struct ctl_table vm_table[] = {\n"
+ " \t\t.proc_handler\t= percpu_pagelist_fraction_sysctl_handler,\n"
+ " \t\t.extra1\t\t= &zero,\n"
+ " \t},\n"
+ "+\t{\n"
+ "+\t\t.procname\t= \"percpu_pagelist_batch\",\n"
+ "+\t\t.data\t\t= &percpu_pagelist_batch,\n"
+ "+\t\t.maxlen\t\t= sizeof(percpu_pagelist_batch),\n"
+ "+\t\t.mode\t\t= 0644,\n"
+ "+\t\t.proc_handler\t= percpu_pagelist_batch_sysctl_handler,\n"
+ "+\t\t.extra1\t\t= &zero,\n"
+ "+\t},\n"
+ " #ifdef CONFIG_MMU\n"
+ " \t{\n"
+ " \t\t.procname\t= \"max_map_count\",\n"
+ "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n"
+ "index 2302f250d6b1..aa96a4bd6467 100644\n"
+ "--- a/mm/page_alloc.c\n"
+ "+++ b/mm/page_alloc.c\n"
+ "@@ -129,6 +129,7 @@ unsigned long totalreserve_pages __read_mostly;\n"
+ " unsigned long totalcma_pages __read_mostly;\n"
+ " \n"
+ " int percpu_pagelist_fraction;\n"
+ "+int percpu_pagelist_batch;\n"
+ " gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;\n"
+ " \n"
+ " /*\n"
+ "@@ -5477,7 +5478,8 @@ static void pageset_set_high_and_batch(struct zone *zone,\n"
+ " \t\t\t(zone->managed_pages /\n"
+ " \t\t\t\tpercpu_pagelist_fraction));\n"
+ " \telse\n"
+ "-\t\tpageset_set_batch(pcp, zone_batchsize(zone));\n"
+ "+\t\tpageset_set_batch(pcp, percpu_pagelist_batch ?\n"
+ "+\t\t\t\tpercpu_pagelist_batch : zone_batchsize(zone));\n"
+ " }\n"
+ " \n"
+ " static void __meminit zone_pageset_init(struct zone *zone, int cpu)\n"
+ "@@ -7157,6 +7159,42 @@ int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *table, int write,\n"
+ " \treturn ret;\n"
+ " }\n"
+ " \n"
+ "+int percpu_pagelist_batch_sysctl_handler(struct ctl_table *table, int write,\n"
+ "+\tvoid __user *buffer, size_t *length, loff_t *ppos)\n"
+ "+{\n"
+ "+\tstruct zone *zone;\n"
+ "+\tint old_percpu_pagelist_batch;\n"
+ "+\tint ret;\n"
+ "+\n"
+ "+\tmutex_lock(&pcp_batch_high_lock);\n"
+ "+\told_percpu_pagelist_batch = percpu_pagelist_batch;\n"
+ "+\n"
+ "+\tret = proc_dointvec_minmax(table, write, buffer, length, ppos);\n"
+ "+\tif (!write || ret < 0)\n"
+ "+\t\tgoto out;\n"
+ "+\n"
+ "+\t/* Sanity checking to avoid pcp imbalance */\n"
+ "+\tif (percpu_pagelist_batch <= 0) {\n"
+ "+\t\tret = -EINVAL;\n"
+ "+\t\tgoto out;\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* No change? */\n"
+ "+\tif (percpu_pagelist_batch == old_percpu_pagelist_batch)\n"
+ "+\t\tgoto out;\n"
+ "+\n"
+ "+\tfor_each_populated_zone(zone) {\n"
+ "+\t\tunsigned int cpu;\n"
+ "+\n"
+ "+\t\tfor_each_possible_cpu(cpu)\n"
+ "+\t\t\tpageset_set_high_and_batch(zone,\n"
+ "+\t\t\t\t\tper_cpu_ptr(zone->pageset, cpu));\n"
+ "+\t}\n"
+ "+out:\n"
+ "+\tmutex_unlock(&pcp_batch_high_lock);\n"
+ "+\treturn ret;\n"
+ "+}\n"
+ "+\n"
+ " #ifdef CONFIG_NUMA\n"
+ " int hashdist = HASHDIST_DEFAULT;\n"
+ " \n"
+ "-- \n"
+ 2.9.5
 
-c7617f01da2149c4477c014e01a9cba900658633787964e171b699958043e8e8
+ac078ab3e4084135f0fdb7c2839a0f9705c79086aa74cec50a92c1b5ee8fe887

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.