linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] mm: reverse lru scanning order
@ 2011-07-27 11:10 Konstantin Khlebnikov
  2011-08-01 16:15 ` Konstantin Khlebnikov
  2011-08-08 11:02 ` [PATCH v2] vmscan: " Konstantin Khlebnikov
  0 siblings, 2 replies; 7+ messages in thread
From: Konstantin Khlebnikov @ 2011-07-27 11:10 UTC (permalink / raw)
  To: linux-mm, Andrew Morton, linux-kernel

LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
"vmscan: Use an indexed array for LRU variables".
Before that commit reclaimer always scan active lists first.

This patch just reverse it back.
This is just notice and question: "Does it affect something?"

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 include/linux/mmzone.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index be1ac8d..88fb49c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -141,7 +141,8 @@ enum lru_list {
 
 #define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++)
 
-#define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++)
+#define for_each_evictable_lru(l) \
+	for (l = LRU_ACTIVE_FILE; l >= LRU_INACTIVE_ANON; l--)
 
 static inline int is_file_lru(enum lru_list l)
 {


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] mm: reverse lru scanning order
  2011-07-27 11:10 [PATCH RFC] mm: reverse lru scanning order Konstantin Khlebnikov
@ 2011-08-01 16:15 ` Konstantin Khlebnikov
  2011-08-01 23:45   ` KOSAKI Motohiro
  2011-08-08 11:02 ` [PATCH v2] vmscan: " Konstantin Khlebnikov
  1 sibling, 1 reply; 7+ messages in thread
From: Konstantin Khlebnikov @ 2011-08-01 16:15 UTC (permalink / raw)
  To: linux-mm, Andrew Morton, linux-kernel

sorry, this patch is broken.

Konstantin Khlebnikov wrote:
> LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
> "vmscan: Use an indexed array for LRU variables".
> Before that commit reclaimer always scan active lists first.
>
> This patch just reverse it back.
> This is just notice and question: "Does it affect something?"
>
> Signed-off-by: Konstantin Khlebnikov<khlebnikov@openvz.org>
> ---
>   include/linux/mmzone.h |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index be1ac8d..88fb49c 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -141,7 +141,8 @@ enum lru_list {
>
>   #define for_each_lru(l) for (l = 0; l<  NR_LRU_LISTS; l++)
>
> -#define for_each_evictable_lru(l) for (l = 0; l<= LRU_ACTIVE_FILE; l++)
> +#define for_each_evictable_lru(l) \
> +	for (l = LRU_ACTIVE_FILE; l>= LRU_INACTIVE_ANON; l--)

there must be some thing like this:

+#define for_each_evictable_lru(l) \
+	for (l = LRU_ACTIVE_FILE; (int)l>= LRU_INACTIVE_ANON; l--)

otherwise gcc silently generates there infinite loop =)

>
>   static inline int is_file_lru(enum lru_list l)
>   {
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] mm: reverse lru scanning order
  2011-08-01 16:15 ` Konstantin Khlebnikov
@ 2011-08-01 23:45   ` KOSAKI Motohiro
  0 siblings, 0 replies; 7+ messages in thread
From: KOSAKI Motohiro @ 2011-08-01 23:45 UTC (permalink / raw)
  To: khlebnikov; +Cc: linux-mm, akpm, linux-kernel

(2011/08/02 1:15), Konstantin Khlebnikov wrote:
> sorry, this patch is broken.

If you resend a _tested_ patch, I'll ack this one.

Thanks.


> 
> Konstantin Khlebnikov wrote:
>> LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
>> "vmscan: Use an indexed array for LRU variables".
>> Before that commit reclaimer always scan active lists first.
>>
>> This patch just reverse it back.
>> This is just notice and question: "Does it affect something?"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] vmscan: reverse lru scanning order
  2011-07-27 11:10 [PATCH RFC] mm: reverse lru scanning order Konstantin Khlebnikov
  2011-08-01 16:15 ` Konstantin Khlebnikov
@ 2011-08-08 11:02 ` Konstantin Khlebnikov
  2011-08-08 12:22   ` Michal Hocko
  2011-08-08 23:48   ` KAMEZAWA Hiroyuki
  1 sibling, 2 replies; 7+ messages in thread
From: Konstantin Khlebnikov @ 2011-08-08 11:02 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: Andrew Morton, KAMEZAWA Hiroyuki

LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
"vmscan: Use an indexed array for LRU variables".
Before that commit reclaimer always scan active lists first.

This patch just reverse it back.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 include/linux/mmzone.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index be1ac8d..0094389 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -141,7 +141,8 @@ enum lru_list {
 
 #define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++)
 
-#define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++)
+#define for_each_evictable_lru(l) \
+	for (l = LRU_ACTIVE_FILE; (int)l >= LRU_INACTIVE_ANON; l--)
 
 static inline int is_file_lru(enum lru_list l)
 {


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] vmscan: reverse lru scanning order
  2011-08-08 11:02 ` [PATCH v2] vmscan: " Konstantin Khlebnikov
@ 2011-08-08 12:22   ` Michal Hocko
  2011-08-08 22:30     ` Minchan Kim
  2011-08-08 23:48   ` KAMEZAWA Hiroyuki
  1 sibling, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2011-08-08 12:22 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-mm, linux-kernel, Andrew Morton, KAMEZAWA Hiroyuki

On Mon 08-08-11 15:02:07, Konstantin Khlebnikov wrote:
> LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
> "vmscan: Use an indexed array for LRU variables".
> Before that commit reclaimer always scan active lists first.
> 
> This patch just reverse it back.

I am still not sure I see why the ordering matters that much.
One thing that might matter is that shrink_list moves some pages from
active to inactive list if inactive is low so it makes sense to try to
shrink active before inactive. It would be a problem if inactive was
almost empty. Then we would just waste time by shrinking inactive first.
I am not sure how real problem is that, though. 

Whatever is the reason, I think it should be documented in the
changelog.
The change makes sense to me.

> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
>  include/linux/mmzone.h |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index be1ac8d..0094389 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -141,7 +141,8 @@ enum lru_list {
>  
>  #define for_each_lru(l) for (l = 0; l < NR_LRU_LISTS; l++)
>  
> -#define for_each_evictable_lru(l) for (l = 0; l <= LRU_ACTIVE_FILE; l++)
> +#define for_each_evictable_lru(l) \
> +	for (l = LRU_ACTIVE_FILE; (int)l >= LRU_INACTIVE_ANON; l--)
>  
>  static inline int is_file_lru(enum lru_list l)
>  {
> 
> --
> 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/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] vmscan: reverse lru scanning order
  2011-08-08 12:22   ` Michal Hocko
@ 2011-08-08 22:30     ` Minchan Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Minchan Kim @ 2011-08-08 22:30 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Konstantin Khlebnikov, linux-mm, linux-kernel, Andrew Morton,
	KAMEZAWA Hiroyuki, Rik van Riel, KOSAKI Motohiro

On Mon, Aug 8, 2011 at 9:22 PM, Michal Hocko <mhocko@suse.cz> wrote:
> On Mon 08-08-11 15:02:07, Konstantin Khlebnikov wrote:
>> LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
>> "vmscan: Use an indexed array for LRU variables".
>> Before that commit reclaimer always scan active lists first.
>>
>> This patch just reverse it back.
>
> I am still not sure I see why the ordering matters that much.
> One thing that might matter is that shrink_list moves some pages from
> active to inactive list if inactive is low so it makes sense to try to
> shrink active before inactive. It would be a problem if inactive was
> almost empty. Then we would just waste time by shrinking inactive first.
> I am not sure how real problem is that, though.
>
> Whatever is the reason, I think it should be documented in the
> changelog.
> The change makes sense to me.
>

Absolutely agree with Michal.
I think the patch itself doesn't have a problem and even it is does make sense.
But we need changelog why we need it.
I don't want to overwrite recent git log without any issue.
It annoys us when we find a bug by git-blame. ;-)
-- 
Kind regards,
Minchan Kim

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] vmscan: reverse lru scanning order
  2011-08-08 11:02 ` [PATCH v2] vmscan: " Konstantin Khlebnikov
  2011-08-08 12:22   ` Michal Hocko
@ 2011-08-08 23:48   ` KAMEZAWA Hiroyuki
  1 sibling, 0 replies; 7+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-08-08 23:48 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: linux-mm, linux-kernel, Andrew Morton

On Mon, 8 Aug 2011 15:02:07 +0400
Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:

> LRU scanning order was accidentially changed in commit v2.6.27-5584-gb69408e:
> "vmscan: Use an indexed array for LRU variables".
> Before that commit reclaimer always scan active lists first.
> 
> This patch just reverse it back.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>

makes sense...but what real problem do you see ?


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-08 23:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 11:10 [PATCH RFC] mm: reverse lru scanning order Konstantin Khlebnikov
2011-08-01 16:15 ` Konstantin Khlebnikov
2011-08-01 23:45   ` KOSAKI Motohiro
2011-08-08 11:02 ` [PATCH v2] vmscan: " Konstantin Khlebnikov
2011-08-08 12:22   ` Michal Hocko
2011-08-08 22:30     ` Minchan Kim
2011-08-08 23:48   ` KAMEZAWA Hiroyuki

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