All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
@ 2009-08-20 18:42 Vincent Li
  2009-08-20 23:00 ` Andrew Morton
  2009-08-21  1:23 ` Fernando Carrijo
  0 siblings, 2 replies; 8+ messages in thread
From: Vincent Li @ 2009-08-20 18:42 UTC (permalink / raw)
  To: linux-mm; +Cc: Andrew Morton, Vincent Li

Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
zone's LRU list number pages.

I know reading the code would clear the name confusion, want to know if patch making sense.
 
Signed-off-by: Vincent Li <macli@brc.ubc.ca>
---
 mm/vmscan.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 00596b9..9a55cb3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -148,7 +148,7 @@ static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone,
 	return &zone->reclaim_stat;
 }
 
-static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
+static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
 				   enum lru_list lru)
 {
 	if (!scanning_global_lru(sc))
@@ -1479,10 +1479,10 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc,
 	unsigned long ap, fp;
 	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
 
-	anon  = zone_nr_pages(zone, sc, LRU_ACTIVE_ANON) +
-		zone_nr_pages(zone, sc, LRU_INACTIVE_ANON);
-	file  = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
-		zone_nr_pages(zone, sc, LRU_INACTIVE_FILE);
+	anon  = zone_lru_nr_pages(zone, sc, LRU_ACTIVE_ANON) +
+		zone_lru_nr_pages(zone, sc, LRU_INACTIVE_ANON);
+	file  = zone_lru_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
+		zone_lru_nr_pages(zone, sc, LRU_INACTIVE_FILE);
 
 	if (scanning_global_lru(sc)) {
 		free  = zone_page_state(zone, NR_FREE_PAGES);
@@ -1590,7 +1590,7 @@ static void shrink_zone(int priority, struct zone *zone,
 		int file = is_file_lru(l);
 		unsigned long scan;
 
-		scan = zone_nr_pages(zone, sc, l);
+		scan = zone_lru_nr_pages(zone, sc, l);
 		if (priority || noswap) {
 			scan >>= priority;
 			scan = (scan * percent[file]) / 100;
-- 
1.6.0.4

--
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 related	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-20 18:42 [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages() Vincent Li
@ 2009-08-20 23:00 ` Andrew Morton
  2009-08-21  0:19   ` Vincent Li
  2009-08-21  1:23 ` Fernando Carrijo
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-08-20 23:00 UTC (permalink / raw)
  To: Vincent Li; +Cc: linux-mm

On Thu, 20 Aug 2009 11:42:54 -0700
Vincent Li <macli@brc.ubc.ca> wrote:

> Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> zone's LRU list number pages.

Fair enough.

> -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,

Wouldn't zone_nr_lru_pages() be better?

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-20 23:00 ` Andrew Morton
@ 2009-08-21  0:19   ` Vincent Li
  2009-08-21  0:22     ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Li @ 2009-08-21  0:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vincent Li, linux-mm

On Thu, 20 Aug 2009, Andrew Morton wrote:

> On Thu, 20 Aug 2009 11:42:54 -0700
> Vincent Li <macli@brc.ubc.ca> wrote:
> 
> > Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> > zone's LRU list number pages.
> 
> Fair enough.
> 
> > -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> > +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
> 
> Wouldn't zone_nr_lru_pages() be better?

I see name isolate_lru_page and the meaning of number of lru pages. your suggestion is better.
should I resend the patch with your suggestion? I ask because I saw you already put the patch in 
the mmotm tree before you send this email out.

Vincent Li
Biomedical Research Center
University of British Columbia

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-21  0:19   ` Vincent Li
@ 2009-08-21  0:22     ` Andrew Morton
  2009-08-21 17:32       ` Fernando Carrijo
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2009-08-21  0:22 UTC (permalink / raw)
  To: Vincent Li; +Cc: linux-mm

On Thu, 20 Aug 2009 17:19:28 -0700 (PDT)
Vincent Li <macli@brc.ubc.ca> wrote:

> On Thu, 20 Aug 2009, Andrew Morton wrote:
> 
> > On Thu, 20 Aug 2009 11:42:54 -0700
> > Vincent Li <macli@brc.ubc.ca> wrote:
> > 
> > > Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> > > zone's LRU list number pages.
> > 
> > Fair enough.
> > 
> > > -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> > > +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
> > 
> > Wouldn't zone_nr_lru_pages() be better?
> 
> I see name isolate_lru_page and the meaning of number of lru pages. your suggestion is better.
> should I resend the patch with your suggestion? I ask because I saw you already put the patch in 
> the mmotm tree before you send this email out.
> 

I edited the diff ;)

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-20 18:42 [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages() Vincent Li
  2009-08-20 23:00 ` Andrew Morton
@ 2009-08-21  1:23 ` Fernando Carrijo
  2009-08-21 17:29   ` Vincent Li
  1 sibling, 1 reply; 8+ messages in thread
From: Fernando Carrijo @ 2009-08-21  1:23 UTC (permalink / raw)
  To: Vincent Li; +Cc: linux-mm, Andrew Morton

On Thu, 2009-08-20 at 11:42 -0700, Vincent Li wrote:
> Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> zone's LRU list number pages.
> 
> I know reading the code would clear the name confusion, want to know if patch making sense.

In case this patch gets an ack, wouldn't it make sense to try to keep
some consistency by renaming the function mem_cgroup_zone_nr_pages to
mem_cgroup_zone_lru_nr_pages, since it also deals with an specific LRU?

Fernando Carrijo

>  
> Signed-off-by: Vincent Li <macli@brc.ubc.ca>
> ---
>  mm/vmscan.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 00596b9..9a55cb3 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -148,7 +148,7 @@ static struct zone_reclaim_stat *get_reclaim_stat(struct zone *zone,
>  	return &zone->reclaim_stat;
>  }
>  
> -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
>  				   enum lru_list lru)
>  {
>  	if (!scanning_global_lru(sc))
> @@ -1479,10 +1479,10 @@ static void get_scan_ratio(struct zone *zone, struct scan_control *sc,
>  	unsigned long ap, fp;
>  	struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
>  
> -	anon  = zone_nr_pages(zone, sc, LRU_ACTIVE_ANON) +
> -		zone_nr_pages(zone, sc, LRU_INACTIVE_ANON);
> -	file  = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
> -		zone_nr_pages(zone, sc, LRU_INACTIVE_FILE);
> +	anon  = zone_lru_nr_pages(zone, sc, LRU_ACTIVE_ANON) +
> +		zone_lru_nr_pages(zone, sc, LRU_INACTIVE_ANON);
> +	file  = zone_lru_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
> +		zone_lru_nr_pages(zone, sc, LRU_INACTIVE_FILE);
>  
>  	if (scanning_global_lru(sc)) {
>  		free  = zone_page_state(zone, NR_FREE_PAGES);
> @@ -1590,7 +1590,7 @@ static void shrink_zone(int priority, struct zone *zone,
>  		int file = is_file_lru(l);
>  		unsigned long scan;
>  
> -		scan = zone_nr_pages(zone, sc, l);
> +		scan = zone_lru_nr_pages(zone, sc, l);
>  		if (priority || noswap) {
>  			scan >>= priority;
>  			scan = (scan * percent[file]) / 100;

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-21  1:23 ` Fernando Carrijo
@ 2009-08-21 17:29   ` Vincent Li
  0 siblings, 0 replies; 8+ messages in thread
From: Vincent Li @ 2009-08-21 17:29 UTC (permalink / raw)
  To: Fernando Carrijo; +Cc: Vincent Li, linux-mm, Andrew Morton

On Thu, 20 Aug 2009, Fernando Carrijo wrote:

> On Thu, 2009-08-20 at 11:42 -0700, Vincent Li wrote:
> > Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> > zone's LRU list number pages.
> > 
> > I know reading the code would clear the name confusion, want to know if patch making sense.
> 
> In case this patch gets an ack, wouldn't it make sense to try to keep
> some consistency by renaming the function mem_cgroup_zone_nr_pages to
> mem_cgroup_zone_lru_nr_pages, since it also deals with an specific LRU?
> 
> Fernando Carrijo
> 

I thought about renaming mem_cgroup_zone_nr_pages too, but not sure if the 
patch make sense  when I submit, so I kept the changes as small as 
possible. 

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-21  0:22     ` Andrew Morton
@ 2009-08-21 17:32       ` Fernando Carrijo
  2009-08-21 17:36         ` Fernando Carrijo
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Carrijo @ 2009-08-21 17:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vincent Li, linux-mm

I sent this very message yesterday and somehow it got lost. Today I'm
resending it with the hope breaks through whatever spam filter it may
find in its way...

On Thu, 2009-08-20 at 17:22 -0700, Andrew Morton wrote:
> On Thu, 20 Aug 2009 17:19:28 -0700 (PDT)
> Vincent Li <macli@brc.ubc.ca> wrote:
> 
> > On Thu, 20 Aug 2009, Andrew Morton wrote:
> > 
> > > On Thu, 20 Aug 2009 11:42:54 -0700
> > > Vincent Li <macli@brc.ubc.ca> wrote:
> > > 
> > > > Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> > > > zone's LRU list number pages.
> > > 
> > > Fair enough.
> > > 
> > > > -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> > > > +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
> > > 
> > > Wouldn't zone_nr_lru_pages() be better?
> > 
> > I see name isolate_lru_page and the meaning of number of lru pages. your suggestion is better.
> > should I resend the patch with your suggestion? I ask because I saw you already put the patch in 
> > the mmotm tree before you send this email out.
> > 
> 
> I edited the diff ;)

Wouldn't it make sense to try to keep some consistency by renaming the
function mem_cgroup_zone_nr_pages to mem_cgroup_zone_nr_lru_pages, for
it also deals with a specific LRU?

Fernando Carrijo

--
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] 8+ messages in thread

* Re: [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages()
  2009-08-21 17:32       ` Fernando Carrijo
@ 2009-08-21 17:36         ` Fernando Carrijo
  0 siblings, 0 replies; 8+ messages in thread
From: Fernando Carrijo @ 2009-08-21 17:36 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vincent Li, linux-mm

On Fri, 2009-08-21 at 14:32 -0300, Fernando Carrijo wrote:
> I sent this very message yesterday and somehow it got lost. Today I'm
> resending it with the hope breaks through whatever spam filter it may
> find in its way...

Oops!

I just received the answers to the suggestions I made yesterday.

Sorry for the noise!

> 
> On Thu, 2009-08-20 at 17:22 -0700, Andrew Morton wrote:
> > On Thu, 20 Aug 2009 17:19:28 -0700 (PDT)
> > Vincent Li <macli@brc.ubc.ca> wrote:
> > 
> > > On Thu, 20 Aug 2009, Andrew Morton wrote:
> > > 
> > > > On Thu, 20 Aug 2009 11:42:54 -0700
> > > > Vincent Li <macli@brc.ubc.ca> wrote:
> > > > 
> > > > > Name zone_nr_pages can be mis-read as zone's (total) number pages, but it actually returns
> > > > > zone's LRU list number pages.
> > > > 
> > > > Fair enough.
> > > > 
> > > > > -static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
> > > > > +static unsigned long zone_lru_nr_pages(struct zone *zone, struct scan_control *sc,
> > > > 
> > > > Wouldn't zone_nr_lru_pages() be better?
> > > 
> > > I see name isolate_lru_page and the meaning of number of lru pages. your suggestion is better.
> > > should I resend the patch with your suggestion? I ask because I saw you already put the patch in 
> > > the mmotm tree before you send this email out.
> > > 
> > 
> > I edited the diff ;)
> 
> Wouldn't it make sense to try to keep some consistency by renaming the
> function mem_cgroup_zone_nr_pages to mem_cgroup_zone_nr_lru_pages, for
> it also deals with a specific LRU?
> 
> Fernando Carrijo
> 
> --
> 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>

--
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] 8+ messages in thread

end of thread, other threads:[~2009-08-21 17:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20 18:42 [PATCH] mm/vmscan: rename zone_nr_pages() to zone_lru_nr_pages() Vincent Li
2009-08-20 23:00 ` Andrew Morton
2009-08-21  0:19   ` Vincent Li
2009-08-21  0:22     ` Andrew Morton
2009-08-21 17:32       ` Fernando Carrijo
2009-08-21 17:36         ` Fernando Carrijo
2009-08-21  1:23 ` Fernando Carrijo
2009-08-21 17:29   ` Vincent Li

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.