* [PATCH 2/3] add inactive ratio calculation function of each zone
@ 2009-05-20 7:19 Minchan Kim
2009-05-20 7:26 ` KOSAKI Motohiro
2009-05-20 10:30 ` Mel Gorman
0 siblings, 2 replies; 4+ messages in thread
From: Minchan Kim @ 2009-05-20 7:19 UTC (permalink / raw)
To: Andrew Morton, LKML, linux-mm
Cc: Mel Gorman, KOSAKI Motohiro, Rik van Riel, Johannes Weiner
This patch divides setup_per_zone_inactive_ratio with
per zone inactive ratio calculaton.
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>
---
include/linux/mm.h | 1 +
mm/page_alloc.c | 14 +++++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1b2cb16..cede957 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1059,6 +1059,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long,
unsigned long, enum memmap_context);
extern void setup_per_zone_wmark_min(void);
+extern void calculate_per_zone_inactive_ratio(struct zone* zone);
extern void mem_init(void);
extern void __init mmap_init(void);
extern void show_mem(void);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 273526b..4601ba0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4552,11 +4552,8 @@ void setup_per_zone_wmark_min(void)
* 1TB 101 10GB
* 10TB 320 32GB
*/
-static void __init setup_per_zone_inactive_ratio(void)
+void calculate_per_zone_inactive_ratio(struct zone* zone)
{
- struct zone *zone;
-
- for_each_zone(zone) {
unsigned int gb, ratio;
/* Zone size in gigabytes */
@@ -4567,7 +4564,14 @@ static void __init setup_per_zone_inactive_ratio(void)
ratio = 1;
zone->inactive_ratio = ratio;
- }
+}
+
+static void __init setup_per_zone_inactive_ratio(void)
+{
+ struct zone *zone;
+
+ for_each_zone(zone)
+ calculate_per_zone_inactive_ratio(zone);
}
/*
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] add inactive ratio calculation function of each zone
2009-05-20 7:19 [PATCH 2/3] add inactive ratio calculation function of each zone Minchan Kim
@ 2009-05-20 7:26 ` KOSAKI Motohiro
2009-05-20 10:30 ` Mel Gorman
1 sibling, 0 replies; 4+ messages in thread
From: KOSAKI Motohiro @ 2009-05-20 7:26 UTC (permalink / raw)
To: Minchan Kim
Cc: kosaki.motohiro, Andrew Morton, LKML, linux-mm, Mel Gorman,
Rik van Riel, Johannes Weiner
> This patch divides setup_per_zone_inactive_ratio with
> per zone inactive ratio calculaton.
>
> 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>
looks good.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
> include/linux/mm.h | 1 +
> mm/page_alloc.c | 14 +++++++++-----
> 2 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 1b2cb16..cede957 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1059,6 +1059,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve);
> extern void memmap_init_zone(unsigned long, int, unsigned long,
> unsigned long, enum memmap_context);
> extern void setup_per_zone_wmark_min(void);
> +extern void calculate_per_zone_inactive_ratio(struct zone* zone);
> extern void mem_init(void);
> extern void __init mmap_init(void);
> extern void show_mem(void);
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 273526b..4601ba0 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4552,11 +4552,8 @@ void setup_per_zone_wmark_min(void)
> * 1TB 101 10GB
> * 10TB 320 32GB
> */
> -static void __init setup_per_zone_inactive_ratio(void)
> +void calculate_per_zone_inactive_ratio(struct zone* zone)
> {
> - struct zone *zone;
> -
> - for_each_zone(zone) {
> unsigned int gb, ratio;
>
> /* Zone size in gigabytes */
> @@ -4567,7 +4564,14 @@ static void __init setup_per_zone_inactive_ratio(void)
> ratio = 1;
>
> zone->inactive_ratio = ratio;
> - }
> +}
> +
> +static void __init setup_per_zone_inactive_ratio(void)
> +{
> + struct zone *zone;
> +
> + for_each_zone(zone)
> + calculate_per_zone_inactive_ratio(zone);
> }
>
> /*
> --
> 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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] add inactive ratio calculation function of each zone
2009-05-20 7:19 [PATCH 2/3] add inactive ratio calculation function of each zone Minchan Kim
2009-05-20 7:26 ` KOSAKI Motohiro
@ 2009-05-20 10:30 ` Mel Gorman
2009-05-20 10:41 ` Minchan Kim
1 sibling, 1 reply; 4+ messages in thread
From: Mel Gorman @ 2009-05-20 10:30 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:19:36PM +0900, Minchan Kim wrote:
> This patch divides setup_per_zone_inactive_ratio with
> per zone inactive ratio calculaton.
>
Why? I'm guessing it's required by the next patch but a note here
explaining why you need it would be nice.
The new function calculates the inactive ratio for one zone, not all zones,
so a a more appropriate name would have been calculate_zone_inactive_ratio().
Is the indenting for calculate_per_zone_inactive_ratio() in too far? It
looks from the patch that it will be indented one tab too many.
> 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>
> ---
> include/linux/mm.h | 1 +
> mm/page_alloc.c | 14 +++++++++-----
> 2 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 1b2cb16..cede957 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1059,6 +1059,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve);
> extern void memmap_init_zone(unsigned long, int, unsigned long,
> unsigned long, enum memmap_context);
> extern void setup_per_zone_wmark_min(void);
> +extern void calculate_per_zone_inactive_ratio(struct zone* zone);
> extern void mem_init(void);
> extern void __init mmap_init(void);
> extern void show_mem(void);
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 273526b..4601ba0 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4552,11 +4552,8 @@ void setup_per_zone_wmark_min(void)
> * 1TB 101 10GB
> * 10TB 320 32GB
> */
> -static void __init setup_per_zone_inactive_ratio(void)
> +void calculate_per_zone_inactive_ratio(struct zone* zone)
> {
> - struct zone *zone;
> -
> - for_each_zone(zone) {
> unsigned int gb, ratio;
>
> /* Zone size in gigabytes */
> @@ -4567,7 +4564,14 @@ static void __init setup_per_zone_inactive_ratio(void)
> ratio = 1;
>
> zone->inactive_ratio = ratio;
> - }
> +}
> +
> +static void __init setup_per_zone_inactive_ratio(void)
> +{
> + struct zone *zone;
> +
> + for_each_zone(zone)
> + calculate_per_zone_inactive_ratio(zone);
> }
>
> /*
> --
> 1.5.4.3
>
>
>
> --
> Kinds Regards
> Minchan Kim
>
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/3] add inactive ratio calculation function of each zone
2009-05-20 10:30 ` Mel Gorman
@ 2009-05-20 10:41 ` Minchan Kim
0 siblings, 0 replies; 4+ messages in thread
From: Minchan Kim @ 2009-05-20 10:41 UTC (permalink / raw)
To: Mel Gorman
Cc: Minchan Kim, Andrew Morton, LKML, linux-mm, KOSAKI Motohiro,
Rik van Riel, Johannes Weiner
On Wed, 20 May 2009 11:30:56 +0100
Mel Gorman <mel@csn.ul.ie> wrote:
> On Wed, May 20, 2009 at 04:19:36PM +0900, Minchan Kim wrote:
> > This patch divides setup_per_zone_inactive_ratio with
> > per zone inactive ratio calculaton.
> >
>
> Why? I'm guessing it's required by the next patch but a note here
> explaining why you need it would be nice.
OK.
> The new function calculates the inactive ratio for one zone, not all zones,
> so a a more appropriate name would have been calculate_zone_inactive_ratio().
Indeed. I will modify function name with that.
> Is the indenting for calculate_per_zone_inactive_ratio() in too far? It
> looks from the patch that it will be indented one tab too many.
Hmm. I can't understand your point due to my poor english.
Could you explain more easily, please ?
>
> > 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>
> > ---
> > include/linux/mm.h | 1 +
> > mm/page_alloc.c | 14 +++++++++-----
> > 2 files changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index 1b2cb16..cede957 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -1059,6 +1059,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve);
> > extern void memmap_init_zone(unsigned long, int, unsigned long,
> > unsigned long, enum memmap_context);
> > extern void setup_per_zone_wmark_min(void);
> > +extern void calculate_per_zone_inactive_ratio(struct zone* zone);
> > extern void mem_init(void);
> > extern void __init mmap_init(void);
> > extern void show_mem(void);
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 273526b..4601ba0 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -4552,11 +4552,8 @@ void setup_per_zone_wmark_min(void)
> > * 1TB 101 10GB
> > * 10TB 320 32GB
> > */
> > -static void __init setup_per_zone_inactive_ratio(void)
> > +void calculate_per_zone_inactive_ratio(struct zone* zone)
> > {
> > - struct zone *zone;
> > -
> > - for_each_zone(zone) {
> > unsigned int gb, ratio;
> >
> > /* Zone size in gigabytes */
> > @@ -4567,7 +4564,14 @@ static void __init setup_per_zone_inactive_ratio(void)
> > ratio = 1;
> >
> > zone->inactive_ratio = ratio;
> > - }
> > +}
> > +
> > +static void __init setup_per_zone_inactive_ratio(void)
> > +{
> > + struct zone *zone;
> > +
> > + for_each_zone(zone)
> > + calculate_per_zone_inactive_ratio(zone);
> > }
> >
> > /*
> > --
> > 1.5.4.3
> >
> >
> >
> > --
> > Kinds Regards
> > Minchan Kim
> >
>
> --
> Mel Gorman
> Part-time Phd Student Linux Technology Center
> University of Limerick IBM Dublin Software Lab
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-20 10:40 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:19 [PATCH 2/3] add inactive ratio calculation function of each zone Minchan Kim
2009-05-20 7:26 ` KOSAKI Motohiro
2009-05-20 10:30 ` Mel Gorman
2009-05-20 10:41 ` Minchan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox