* [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens
@ 2009-05-20 7:20 Minchan Kim
2009-05-20 7:34 ` KOSAKI Motohiro
2009-05-20 10:32 ` Mel Gorman
0 siblings, 2 replies; 4+ messages in thread
From: Minchan Kim @ 2009-05-20 7:20 UTC (permalink / raw)
To: Andrew Morton, LKML, linux-mm
Cc: Mel Gorman, KOSAKI Motohiro, Rik van Riel, Johannes Weiner
This patch solve two problems.
Whenever memory hotplug sucessfully happens, zone->present_pages
have to be changed.
1) Now, memory hotplug calls setup_per_zone_wmark_min only when
online_pages called, not offline_pages.
It breaks balance.
2) If zone->present_pages is changed, we also have to change
zone->inactive_ratio. That's because inactive_ratio depends
on zone->present_pages.
CC: Mel Gorman <mel@csn.ul.ie>
CC: Rik van Riel <riel@redhat.com>
CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/memory_hotplug.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 40bf385..1611010 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -423,6 +423,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
zone->zone_pgdat->node_present_pages += onlined_pages;
setup_per_zone_wmark_min();
+ calculate_per_zone_inactive_ratio(zone);
if (onlined_pages) {
kswapd_run(zone_to_nid(zone));
node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
@@ -832,6 +833,9 @@ repeat:
totalram_pages -= offlined_pages;
num_physpages -= offlined_pages;
+ setup_per_zone_wmark_min();
+ calculate_per_zone_inactive_ratio(zone);
+
vm_total_pages = nr_free_pagecache_pages();
writeback_set_ratelimit();
--
1.5.4.3
--
Kinds Regards
Minchan Kim
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens
2009-05-20 7:20 [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens Minchan Kim
@ 2009-05-20 7:34 ` KOSAKI Motohiro
2009-05-20 8:08 ` Yasunori Goto
2009-05-20 10:32 ` Mel Gorman
1 sibling, 1 reply; 4+ messages in thread
From: KOSAKI Motohiro @ 2009-05-20 7:34 UTC (permalink / raw)
To: Minchan Kim
Cc: kosaki.motohiro, Andrew Morton, LKML, linux-mm, Mel Gorman,
Rik van Riel, Johannes Weiner, KAMEZAWA Hiroyuki, Yasunori Goto
> This patch solve two problems.
>
> Whenever memory hotplug sucessfully happens, zone->present_pages
> have to be changed.
>
> 1) Now, memory hotplug calls setup_per_zone_wmark_min only when
> online_pages called, not offline_pages.
>
> It breaks balance.
>
> 2) If zone->present_pages is changed, we also have to change
> zone->inactive_ratio. That's because inactive_ratio depends
> on zone->present_pages.
Good catch!
looks good to me. but I'm not familiar this area. CC to Goto-san.
> CC: Mel Gorman <mel@csn.ul.ie>
> CC: Rik van Riel <riel@redhat.com>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
> mm/memory_hotplug.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 40bf385..1611010 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -423,6 +423,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
> zone->zone_pgdat->node_present_pages += onlined_pages;
>
> setup_per_zone_wmark_min();
> + calculate_per_zone_inactive_ratio(zone);
> if (onlined_pages) {
> kswapd_run(zone_to_nid(zone));
> node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
> @@ -832,6 +833,9 @@ repeat:
> totalram_pages -= offlined_pages;
> num_physpages -= offlined_pages;
>
> + setup_per_zone_wmark_min();
> + calculate_per_zone_inactive_ratio(zone);
> +
> vm_total_pages = nr_free_pagecache_pages();
> writeback_set_ratelimit();
>
> --
> 1.5.4.3
>
>
>
> --
> Kinds Regards
> Minchan Kim
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens
2009-05-20 7:34 ` KOSAKI Motohiro
@ 2009-05-20 8:08 ` Yasunori Goto
0 siblings, 0 replies; 4+ messages in thread
From: Yasunori Goto @ 2009-05-20 8:08 UTC (permalink / raw)
To: KOSAKI Motohiro
Cc: Minchan Kim, Andrew Morton, LKML, linux-mm, Mel Gorman,
Rik van Riel, Johannes Weiner, KAMEZAWA Hiroyuki
> > This patch solve two problems.
> >
> > Whenever memory hotplug sucessfully happens, zone->present_pages
> > have to be changed.
> >
> > 1) Now, memory hotplug calls setup_per_zone_wmark_min only when
> > online_pages called, not offline_pages.
> >
> > It breaks balance.
> >
> > 2) If zone->present_pages is changed, we also have to change
> > zone->inactive_ratio. That's because inactive_ratio depends
> > on zone->present_pages.
>
> Good catch!
> looks good to me. but I'm not familiar this area. CC to Goto-san.
>
Thanks. Looks good!
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
>
>
>
>
> > CC: Mel Gorman <mel@csn.ul.ie>
> > CC: Rik van Riel <riel@redhat.com>
> > CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > CC: Johannes Weiner <hannes@cmpxchg.org>
> > Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> > ---
> > mm/memory_hotplug.c | 4 ++++
> > 1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> > index 40bf385..1611010 100644
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -423,6 +423,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
> > zone->zone_pgdat->node_present_pages += onlined_pages;
> >
> > setup_per_zone_wmark_min();
> > + calculate_per_zone_inactive_ratio(zone);
> > if (onlined_pages) {
> > kswapd_run(zone_to_nid(zone));
> > node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
> > @@ -832,6 +833,9 @@ repeat:
> > totalram_pages -= offlined_pages;
> > num_physpages -= offlined_pages;
> >
> > + setup_per_zone_wmark_min();
> > + calculate_per_zone_inactive_ratio(zone);
> > +
> > vm_total_pages = nr_free_pagecache_pages();
> > writeback_set_ratelimit();
> >
> > --
> > 1.5.4.3
> >
> >
> >
> > --
> > Kinds Regards
> > Minchan Kim
>
>
>
> --
> 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>
--
Yasunori Goto
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens
2009-05-20 7:20 [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens Minchan Kim
2009-05-20 7:34 ` KOSAKI Motohiro
@ 2009-05-20 10:32 ` Mel Gorman
1 sibling, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2009-05-20 10:32 UTC (permalink / raw)
To: Minchan Kim
Cc: Andrew Morton, LKML, linux-mm, KOSAKI Motohiro, Rik van Riel,
Johannes Weiner
On Wed, May 20, 2009 at 04:20:01PM +0900, Minchan Kim wrote:
> This patch solve two problems.
>
> Whenever memory hotplug sucessfully happens, zone->present_pages
> have to be changed.
>
> 1) Now, memory hotplug calls setup_per_zone_wmark_min only when
> online_pages called, not offline_pages.
>
> It breaks balance.
>
Very true.
> 2) If zone->present_pages is changed, we also have to change
> zone->inactive_ratio. That's because inactive_ratio depends
> on zone->present_pages.
>
> CC: Mel Gorman <mel@csn.ul.ie>
> CC: Rik van Riel <riel@redhat.com>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
> mm/memory_hotplug.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 40bf385..1611010 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -423,6 +423,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
> zone->zone_pgdat->node_present_pages += onlined_pages;
>
> setup_per_zone_wmark_min();
> + calculate_per_zone_inactive_ratio(zone);
> if (onlined_pages) {
> kswapd_run(zone_to_nid(zone));
> node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
> @@ -832,6 +833,9 @@ repeat:
> totalram_pages -= offlined_pages;
> num_physpages -= offlined_pages;
>
> + setup_per_zone_wmark_min();
> + calculate_per_zone_inactive_ratio(zone);
> +
> vm_total_pages = nr_free_pagecache_pages();
> writeback_set_ratelimit();
>
Seems sensible.;
> --
> 1.5.4.3
>
>
>
> --
> Kinds Regards
> Minchan Kim
>
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-20 10:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 7:20 [PATCH 3/3] reset wmark_min and inactive ratio of zone when hotplug happens Minchan Kim
2009-05-20 7:34 ` KOSAKI Motohiro
2009-05-20 8:08 ` Yasunori Goto
2009-05-20 10:32 ` Mel Gorman
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).