From: daniel.m.jordan@oracle.com
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: aaron.lu@intel.com, ak@linux.intel.com,
akpm@linux-foundation.org, Dave.Dice@oracle.com,
dave@stgolabs.net, khandual@linux.vnet.ibm.com,
ldufour@linux.vnet.ibm.com, mgorman@suse.de, mhocko@kernel.org,
pasha.tatashin@oracle.com, steven.sistare@oracle.com,
yossi.lev@oracle.com
Subject: [RFC PATCH v1 01/13] mm: add a percpu_pagelist_batch sysctl interface
Date: Wed, 31 Jan 2018 18:04:01 -0500 [thread overview]
Message-ID: <20180131230413.27653-2-daniel.m.jordan@oracle.com> (raw)
In-Reply-To: <20180131230413.27653-1-daniel.m.jordan@oracle.com>
From: 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 67f2e3c38939..c05529473b80 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -891,6 +891,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 557d46728577..1602bc14bf0d 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
@@ -1458,6 +1459,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 76c9688b6a0a..d7078ed68b01 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -130,6 +130,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;
/*
@@ -5544,7 +5545,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)
@@ -7266,6 +7268,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.16.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2018-01-31 23:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 23:04 [RFC PATCH v1 00/13] lru_lock scalability daniel.m.jordan
2018-01-31 23:04 ` daniel.m.jordan [this message]
2018-01-31 23:04 ` [RFC PATCH v1 02/13] mm: allow compaction to be disabled daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 03/13] mm: add lock array to pgdat and batch fields to struct page daniel.m.jordan
2018-02-01 22:50 ` Tim Chen
2018-02-02 4:29 ` Daniel Jordan
2018-01-31 23:04 ` [RFC PATCH v1 04/13] mm: introduce struct lru_list_head in lruvec to hold per-LRU batch info daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 05/13] mm: add batching logic to add/delete/move API's daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 06/13] mm: add lru_[un]lock_all APIs daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 07/13] mm: convert to-be-refactored lru_lock callsites to lock-all API daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 08/13] mm: temporarily convert " daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 09/13] mm: introduce add-only version of pagevec_lru_move_fn daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 10/13] mm: add LRU batch lock API's daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 11/13] mm: use lru_batch locking in release_pages daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 12/13] mm: split up release_pages into non-sentinel and sentinel passes daniel.m.jordan
2018-02-02 14:40 ` Laurent Dufour
2018-02-02 17:00 ` Laurent Dufour
2018-02-06 17:47 ` Daniel Jordan
2018-02-05 4:58 ` [lkp-robot] [mm] 44b163e12f: kernel_BUG_at_mm/swap.c kernel test robot
2018-01-31 23:04 ` [RFC PATCH v1 13/13] mm: splice local lists onto the front of the LRU daniel.m.jordan
2018-02-01 23:30 ` Tim Chen
2018-02-02 5:17 ` Daniel Jordan
2018-02-02 5:21 ` Aaron Lu
2018-02-06 17:38 ` Daniel Jordan
2018-02-02 15:22 ` Laurent Dufour
2018-02-06 18:18 ` Daniel Jordan
2018-02-01 15:54 ` [RFC PATCH v1 00/13] lru_lock scalability Steven Whitehouse
2018-02-02 4:18 ` Daniel Jordan
2018-02-02 10:50 ` Steven Whitehouse
2018-02-08 23:36 ` Andrew Morton
2018-02-13 21:07 ` Daniel Jordan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131230413.27653-2-daniel.m.jordan@oracle.com \
--to=daniel.m.jordan@oracle.com \
--cc=Dave.Dice@oracle.com \
--cc=aaron.lu@intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=khandual@linux.vnet.ibm.com \
--cc=ldufour@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=pasha.tatashin@oracle.com \
--cc=steven.sistare@oracle.com \
--cc=yossi.lev@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).