linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memcg reclaim shouldn't change zone->recent_rotated statics.
@ 2008-11-25  3:22 KOSAKI Motohiro
  2008-11-25 15:51 ` Rik van Riel
  2008-11-25 23:54 ` Andrew Morton
  0 siblings, 2 replies; 8+ messages in thread
From: KOSAKI Motohiro @ 2008-11-25  3:22 UTC (permalink / raw)
  To: Rik van Riel, LKML, linux-mm, Andrew Morton; +Cc: kosaki.motohiro

Hi

this is a trivial bugfix.
I think this is not serious bug.
but if memcgroup reclaim change zone statics, global reclaim can confusion a bit.


================================================
memcg reclaim shouldn't change zone->recent_rotated statics.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Rik van Riel <riel@redhat.com>
---
 mm/vmscan.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c	2008-11-24 06:20:24.000000000 +0900
+++ b/mm/vmscan.c	2008-11-25 01:29:16.000000000 +0900
@@ -1254,7 +1254,8 @@ static void shrink_active_list(unsigned 
 	 * This helps balance scan pressure between file and anonymous
 	 * pages in get_scan_ratio.
 	 */
-	zone->recent_rotated[!!file] += pgmoved;
+	if (scan_global_lru(sc))
+		zone->recent_rotated[!!file] += pgmoved;
 
 	/*
 	 * Move the pages to the [file or anon] inactive list.


--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-25  3:22 [PATCH] memcg reclaim shouldn't change zone->recent_rotated statics KOSAKI Motohiro
@ 2008-11-25 15:51 ` Rik van Riel
  2008-11-25 23:54 ` Andrew Morton
  1 sibling, 0 replies; 8+ messages in thread
From: Rik van Riel @ 2008-11-25 15:51 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: LKML, linux-mm, Andrew Morton

KOSAKI Motohiro wrote:

> memcg reclaim shouldn't change zone->recent_rotated statics.
> 
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Rik van Riel <riel@redhat.com>

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All Rights Reversed

--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-25  3:22 [PATCH] memcg reclaim shouldn't change zone->recent_rotated statics KOSAKI Motohiro
  2008-11-25 15:51 ` Rik van Riel
@ 2008-11-25 23:54 ` Andrew Morton
  2008-11-26  0:13   ` KOSAKI Motohiro
  2008-11-27  3:49   ` KAMEZAWA Hiroyuki
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2008-11-25 23:54 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: riel, linux-kernel, linux-mm

On Tue, 25 Nov 2008 12:22:53 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

> +	if (scan_global_lru(sc))

mutter.  scan_global_lru() is a terrible function name.  Anyone reading
that code would expect that this function, umm, scans the global LRU.

gcc has a nice convention wherein such functions have a name ending in
"_p" (for "predicate").  Don't do this :)

--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-25 23:54 ` Andrew Morton
@ 2008-11-26  0:13   ` KOSAKI Motohiro
  2008-11-26  0:16     ` Alan Cox
  2008-11-27  3:49   ` KAMEZAWA Hiroyuki
  1 sibling, 1 reply; 8+ messages in thread
From: KOSAKI Motohiro @ 2008-11-26  0:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: kosaki.motohiro, riel, linux-kernel, linux-mm

> On Tue, 25 Nov 2008 12:22:53 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> 
> > +	if (scan_global_lru(sc))
> 
> mutter.  scan_global_lru() is a terrible function name.  Anyone reading
> that code would expect that this function, umm, scans the global LRU.

yup.

> gcc has a nice convention wherein such functions have a name ending in
> "_p" (for "predicate").  Don't do this :)

however, "_p" isn't linux convention.
so, I like "is_" or "can_" (or likes somethingelse) prefix :)



--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-26  0:13   ` KOSAKI Motohiro
@ 2008-11-26  0:16     ` Alan Cox
  2008-11-26  0:19       ` KOSAKI Motohiro
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2008-11-26  0:16 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: Andrew Morton, riel, linux-kernel, linux-mm

> however, "_p" isn't linux convention.
> so, I like "is_" or "can_" (or likes somethingelse) prefix :)

_p is from lisp but Ted did sneak tty_hung_up_p() into the kernel many
years ago.

--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-26  0:16     ` Alan Cox
@ 2008-11-26  0:19       ` KOSAKI Motohiro
  0 siblings, 0 replies; 8+ messages in thread
From: KOSAKI Motohiro @ 2008-11-26  0:19 UTC (permalink / raw)
  To: Alan Cox; +Cc: kosaki.motohiro, Andrew Morton, riel, linux-kernel, linux-mm

> > however, "_p" isn't linux convention.
> > so, I like "is_" or "can_" (or likes somethingelse) prefix :)
> 
> _p is from lisp but Ted did sneak tty_hung_up_p() into the kernel many
> years ago.

Oh, you expose my knowledgeless ;-)



--
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] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-25 23:54 ` Andrew Morton
  2008-11-26  0:13   ` KOSAKI Motohiro
@ 2008-11-27  3:49   ` KAMEZAWA Hiroyuki
  2008-11-27  3:59     ` Johannes Weiner
  1 sibling, 1 reply; 8+ messages in thread
From: KAMEZAWA Hiroyuki @ 2008-11-27  3:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: KOSAKI Motohiro, riel, linux-kernel, linux-mm

On Tue, 25 Nov 2008 15:54:22 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 25 Nov 2008 12:22:53 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> 
> > +	if (scan_global_lru(sc))
> 
> mutter.  scan_global_lru() is a terrible function name.  Anyone reading
> that code would expect that this function, umm, scans the global LRU.
> 
> gcc has a nice convention wherein such functions have a name ending in
> "_p" (for "predicate").  Don't do this :)
> 

Hmm, I'll prepare renaming patch.

scan_global_lru_p() ? or under_scanning_global_lru() ?


Thanks,
-Kame

> --
> 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

* Re: [PATCH] memcg reclaim shouldn't change zone->recent_rotated statics.
  2008-11-27  3:49   ` KAMEZAWA Hiroyuki
@ 2008-11-27  3:59     ` Johannes Weiner
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Weiner @ 2008-11-27  3:59 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Andrew Morton, KOSAKI Motohiro, riel, linux-kernel, linux-mm

On Thu, Nov 27, 2008 at 12:49:46PM +0900, KAMEZAWA Hiroyuki wrote:
> On Tue, 25 Nov 2008 15:54:22 -0800
> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Tue, 25 Nov 2008 12:22:53 +0900 (JST)
> > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> > 
> > > +	if (scan_global_lru(sc))
> > 
> > mutter.  scan_global_lru() is a terrible function name.  Anyone reading
> > that code would expect that this function, umm, scans the global LRU.
> > 
> > gcc has a nice convention wherein such functions have a name ending in
> > "_p" (for "predicate").  Don't do this :)
> > 
> 
> Hmm, I'll prepare renaming patch.
> 
> scan_global_lru_p() ?

That only works well when you don't have to use underscores, "listp"
or in Lisps where words can be hyphenated "loaded-module-p". 

But scan_global_lru_p() looks terrible.

> or under_scanning_global_lru() ?

How about just scanning_global_lru()?

	Hannes

--
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:[~2008-11-27  3:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-25  3:22 [PATCH] memcg reclaim shouldn't change zone->recent_rotated statics KOSAKI Motohiro
2008-11-25 15:51 ` Rik van Riel
2008-11-25 23:54 ` Andrew Morton
2008-11-26  0:13   ` KOSAKI Motohiro
2008-11-26  0:16     ` Alan Cox
2008-11-26  0:19       ` KOSAKI Motohiro
2008-11-27  3:49   ` KAMEZAWA Hiroyuki
2008-11-27  3:59     ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox