Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1458435 > unrolled thread
| Started by | js1304@gmail.com |
|---|---|
| First post | 2016-08-09 08:40 +0200 |
| Last post | 2016-08-09 09:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] mm/page_alloc: fix wrong initialization when sysctl_min_unmapped_ratio changes js1304@gmail.com - 2016-08-09 08:40 +0200
[PATCH 2/2] mm/page_alloc: recalculate some of node threshold when on/offline memory js1304@gmail.com - 2016-08-09 08:40 +0200
Re: [PATCH 2/2] mm/page_alloc: recalculate some of node threshold when on/offline memory Mel Gorman <mgorman@techsingularity.net> - 2016-08-09 09:40 +0200
Re: [PATCH 1/2] mm/page_alloc: fix wrong initialization when sysctl_min_unmapped_ratio changes Mel Gorman <mgorman@techsingularity.net> - 2016-08-09 09:30 +0200
| From | js1304@gmail.com |
|---|---|
| Date | 2016-08-09 08:40 +0200 |
| Subject | [PATCH 1/2] mm/page_alloc: fix wrong initialization when sysctl_min_unmapped_ratio changes |
| Message-ID | <s48RH-3Wx-5@gated-at.bofh.it> |
From: Joonsoo Kim <iamjoonsoo.kim@lge.com> Before resetting min_unmapped_pages, we need to initialize min_unmapped_pages rather than min_slab_pages. Fixes: a5f5f91da6 (mm: convert zone_reclaim to node_reclaim) Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index afdb7f8..555b609 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6894,7 +6894,7 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write, return rc; for_each_online_pgdat(pgdat) - pgdat->min_slab_pages = 0; + pgdat->min_unmapped_pages = 0; for_each_zone(zone) zone->zone_pgdat->min_unmapped_pages += (zone->managed_pages * -- 1.9.1
[toc] | [next] | [standalone]
| From | js1304@gmail.com |
|---|---|
| Date | 2016-08-09 08:40 +0200 |
| Subject | [PATCH 2/2] mm/page_alloc: recalculate some of node threshold when on/offline memory |
| Message-ID | <s48RH-3Wx-11@gated-at.bofh.it> |
| In reply to | #1458435 |
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Some of node threshold depends on number of managed pages in the node.
When memory is going on/offline, it can be changed and we need to
adjust them.
This patch add recalculation to appropriate places and clean-up
related function for better maintanance.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
mm/page_alloc.c | 50 +++++++++++++++++++++++++++++++++++---------------
1 file changed, 35 insertions(+), 15 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 555b609..277c3d0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4793,6 +4793,8 @@ int local_memory_node(int node)
}
#endif
+static void setup_min_unmapped_ratio(void);
+static void setup_min_slab_ratio(void);
#else /* CONFIG_NUMA */
static void set_zonelist_order(void)
@@ -5914,9 +5916,6 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
zone->managed_pages = is_highmem_idx(j) ? realsize : freesize;
#ifdef CONFIG_NUMA
zone->node = nid;
- pgdat->min_unmapped_pages += (freesize*sysctl_min_unmapped_ratio)
- / 100;
- pgdat->min_slab_pages += (freesize * sysctl_min_slab_ratio) / 100;
#endif
zone->name = zone_names[j];
zone->zone_pgdat = pgdat;
@@ -6841,6 +6840,12 @@ int __meminit init_per_zone_wmark_min(void)
setup_per_zone_wmarks();
refresh_zone_stat_thresholds();
setup_per_zone_lowmem_reserve();
+
+#ifdef CONFIG_NUMA
+ setup_min_unmapped_ratio();
+ setup_min_slab_ratio();
+#endif
+
return 0;
}
core_initcall(init_per_zone_wmark_min)
@@ -6882,16 +6887,10 @@ int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write,
}
#ifdef CONFIG_NUMA
-int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write,
- void __user *buffer, size_t *length, loff_t *ppos)
+static void setup_min_unmapped_ratio(void)
{
- struct pglist_data *pgdat;
+ pg_data_t *pgdat;
struct zone *zone;
- int rc;
-
- rc = proc_dointvec_minmax(table, write, buffer, length, ppos);
- if (rc)
- return rc;
for_each_online_pgdat(pgdat)
pgdat->min_unmapped_pages = 0;
@@ -6899,26 +6898,47 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write,
for_each_zone(zone)
zone->zone_pgdat->min_unmapped_pages += (zone->managed_pages *
sysctl_min_unmapped_ratio) / 100;
- return 0;
}
-int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int write,
+
+int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
- struct pglist_data *pgdat;
- struct zone *zone;
int rc;
rc = proc_dointvec_minmax(table, write, buffer, length, ppos);
if (rc)
return rc;
+ setup_min_unmapped_ratio();
+
+ return 0;
+}
+
+static void setup_min_slab_ratio(void)
+{
+ pg_data_t *pgdat;
+ struct zone *zone;
+
for_each_online_pgdat(pgdat)
pgdat->min_slab_pages = 0;
for_each_zone(zone)
zone->zone_pgdat->min_slab_pages += (zone->managed_pages *
sysctl_min_slab_ratio) / 100;
+}
+
+int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int write,
+ void __user *buffer, size_t *length, loff_t *ppos)
+{
+ int rc;
+
+ rc = proc_dointvec_minmax(table, write, buffer, length, ppos);
+ if (rc)
+ return rc;
+
+ setup_min_slab_ratio();
+
return 0;
}
#endif
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Mel Gorman <mgorman@techsingularity.net> |
|---|---|
| Date | 2016-08-09 09:40 +0200 |
| Subject | Re: [PATCH 2/2] mm/page_alloc: recalculate some of node threshold when on/offline memory |
| Message-ID | <s49NL-4yq-5@gated-at.bofh.it> |
| In reply to | #1458437 |
On Tue, Aug 09, 2016 at 03:30:48PM +0900, js1304@gmail.com wrote: > From: Joonsoo Kim <iamjoonsoo.kim@lge.com> > > Some of node threshold depends on number of managed pages in the node. > When memory is going on/offline, it can be changed and we need to > adjust them. > > This patch add recalculation to appropriate places and clean-up > related function for better maintanance. > > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> -- Mel Gorman SUSE Labs
[toc] | [prev] | [next] | [standalone]
| From | Mel Gorman <mgorman@techsingularity.net> |
|---|---|
| Date | 2016-08-09 09:30 +0200 |
| Subject | Re: [PATCH 1/2] mm/page_alloc: fix wrong initialization when sysctl_min_unmapped_ratio changes |
| Message-ID | <s49E5-4tO-1@gated-at.bofh.it> |
| In reply to | #1458435 |
On Tue, Aug 09, 2016 at 03:30:47PM +0900, js1304@gmail.com wrote: > From: Joonsoo Kim <iamjoonsoo.kim@lge.com> > > Before resetting min_unmapped_pages, we need to initialize > min_unmapped_pages rather than min_slab_pages. > > Fixes: a5f5f91da6 (mm: convert zone_reclaim to node_reclaim) > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> -- Mel Gorman SUSE Labs
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web