linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] __isolate_lru_page: skip unneeded mode check
@ 2010-03-31 14:10 Bob Liu
  2010-03-31 14:17 ` KOSAKI Motohiro
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Liu @ 2010-03-31 14:10 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, kosaki.motohiro, Bob Liu

From: Bob Liu <lliubbo@gmail.com>

Whether mode is ISOLATE_BOTH or not, we should compare
page_is_file_cache with argument file.

And there is no more need not when checking the active state.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
 mm/vmscan.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e0e5f15..34d7e3d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -862,15 +862,10 @@ int __isolate_lru_page(struct page *page, int mode, int file)
 	if (!PageLRU(page))
 		return ret;
 
-	/*
-	 * When checking the active state, we need to be sure we are
-	 * dealing with comparible boolean values.  Take the logical not
-	 * of each.
-	 */
-	if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
+	if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
 		return ret;
 
-	if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
+	if (page_is_file_cache(page) != file)
 		return ret;
 
 	/*
-- 
1.5.6.3

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

* Re: [PATCH] __isolate_lru_page: skip unneeded mode check
  2010-03-31 14:10 [PATCH] __isolate_lru_page: skip unneeded mode check Bob Liu
@ 2010-03-31 14:17 ` KOSAKI Motohiro
  2010-04-01  1:30   ` Bob Liu
  0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2010-03-31 14:17 UTC (permalink / raw)
  To: Bob Liu; +Cc: akpm, linux-mm

2010/3/31 Bob Liu <lliubbo@gmail.com>:
> From: Bob Liu <lliubbo@gmail.com>
>
> Whether mode is ISOLATE_BOTH or not, we should compare
> page_is_file_cache with argument file.
>
> And there is no more need not when checking the active state.
>
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> ---
>  mm/vmscan.c |    9 ++-------
>  1 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index e0e5f15..34d7e3d 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -862,15 +862,10 @@ int __isolate_lru_page(struct page *page, int mode, int file)
>        if (!PageLRU(page))
>                return ret;
>
> -       /*
> -        * When checking the active state, we need to be sure we are
> -        * dealing with comparible boolean values.  Take the logical not
> -        * of each.
> -        */
> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
>                return ret;

no. please read the comment.

> -       if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
> +       if (page_is_file_cache(page) != file)
>                return ret;

no. please consider lumpy reclaim.

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

* Re: [PATCH] __isolate_lru_page: skip unneeded mode check
  2010-03-31 14:17 ` KOSAKI Motohiro
@ 2010-04-01  1:30   ` Bob Liu
  2010-04-01  1:39     ` KOSAKI Motohiro
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Liu @ 2010-04-01  1:30 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: akpm, linux-mm

On 3/31/10, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> 2010/3/31 Bob Liu <lliubbo@gmail.com>:
>> From: Bob Liu <lliubbo@gmail.com>
>>
>> Whether mode is ISOLATE_BOTH or not, we should compare
>> page_is_file_cache with argument file.
>>
>> And there is no more need not when checking the active state.
>>
>> Signed-off-by: Bob Liu <lliubbo@gmail.com>
>> ---
>>  mm/vmscan.c |    9 ++-------
>>  1 files changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index e0e5f15..34d7e3d 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -862,15 +862,10 @@ int __isolate_lru_page(struct page *page, int mode,
>> int file)
>>        if (!PageLRU(page))
>>                return ret;
>>
>> -       /*
>> -        * When checking the active state, we need to be sure we are
>> -        * dealing with comparible boolean values.  Take the logical not
>> -        * of each.
>> -        */
>> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
>> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
>>                return ret;
>
> no. please read the comment.
>

Hm,. I have read it, but still miss it :-).
PageActive(page) will return an int 0 or 1, mode is also int 0 or 1(
already != ISOLATE_BOTH).
There are comparible and why must to be sure to boolean values?

>> -       if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
>> +       if (page_is_file_cache(page) != file)
>>                return ret;
>
> no. please consider lumpy reclaim.
>

During lumpy reclaim mode is ISOLATE_BOTH, that case we don't check
page_is_file_cache() ?  Would you please explain it a little more ,i
am still unclear about it.
Thanks a lot.
-- 
Regards,
--Bob

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

* Re: [PATCH] __isolate_lru_page: skip unneeded mode check
  2010-04-01  1:30   ` Bob Liu
@ 2010-04-01  1:39     ` KOSAKI Motohiro
  2010-04-01 13:42       ` Bob Liu
  0 siblings, 1 reply; 5+ messages in thread
From: KOSAKI Motohiro @ 2010-04-01  1:39 UTC (permalink / raw)
  To: Bob Liu; +Cc: kosaki.motohiro, akpm, linux-mm

> >> @@ -862,15 +862,10 @@ int __isolate_lru_page(struct page *page, int mode,
> >> int file)
> >>        if (!PageLRU(page))
> >>                return ret;
> >>
> >> -       /*
> >> -        * When checking the active state, we need to be sure we are
> >> -        * dealing with comparible boolean values.  Take the logical not
> >> -        * of each.
> >> -        */
> >> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
> >> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
> >>                return ret;
> >
> > no. please read the comment.
> >
> 
> Hm,. I have read it, but still miss it :-).
> PageActive(page) will return an int 0 or 1, mode is also int 0 or 1(
> already != ISOLATE_BOTH).
> There are comparible and why must to be sure to boolean values?

hm, ok. you are right.
please resend this part as individual patch.


> >> -       if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
> >> +       if (page_is_file_cache(page) != file)
> >>                return ret;
> >
> > no. please consider lumpy reclaim.
> 
> During lumpy reclaim mode is ISOLATE_BOTH, that case we don't check
> page_is_file_cache() ?  Would you please explain it a little more ,i
> am still unclear about it.
> Thanks a lot.

ISOLATE_BOTH is for to help allocate high order memory. then,
it ignore both PageActive() and page_is_file_cache(). otherwise,
we fail to allocate high order memory.


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

* Re: [PATCH] __isolate_lru_page: skip unneeded mode check
  2010-04-01  1:39     ` KOSAKI Motohiro
@ 2010-04-01 13:42       ` Bob Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Liu @ 2010-04-01 13:42 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: akpm, linux-mm

On Thu, Apr 1, 2010 at 9:39 AM, KOSAKI Motohiro
<kosaki.motohiro@jp.fujitsu.com> wrote:
>> >> @@ -862,15 +862,10 @@ int __isolate_lru_page(struct page *page, int mode,
>> >> int file)
>> >>        if (!PageLRU(page))
>> >>                return ret;
>> >>
>> >> -       /*
>> >> -        * When checking the active state, we need to be sure we are
>> >> -        * dealing with comparible boolean values.  Take the logical not
>> >> -        * of each.
>> >> -        */
>> >> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
>> >> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
>> >>                return ret;
>> >
>> > no. please read the comment.
>> >
>>
>> Hm,. I have read it, but still miss it :-).
>> PageActive(page) will return an int 0 or 1, mode is also int 0 or 1(
>> already != ISOLATE_BOTH).
>> There are comparible and why must to be sure to boolean values?
>
> hm, ok. you are right.
> please resend this part as individual patch.
>

I have resent this part :-).

>
>> >> -       if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
>> >> +       if (page_is_file_cache(page) != file)
>> >>                return ret;
>> >
>> > no. please consider lumpy reclaim.
>>
>> During lumpy reclaim mode is ISOLATE_BOTH, that case we don't check
>> page_is_file_cache() ?  Would you please explain it a little more ,i
>> am still unclear about it.
>> Thanks a lot.
>
> ISOLATE_BOTH is for to help allocate high order memory. then,
> it ignore both PageActive() and page_is_file_cache(). otherwise,
> we fail to allocate high order memory.
>

I got it, thanks.
And I have resent a patch collected ISOLATE_BOTH check.

-- 
Regards,
--Bob

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

end of thread, other threads:[~2010-04-01 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 14:10 [PATCH] __isolate_lru_page: skip unneeded mode check Bob Liu
2010-03-31 14:17 ` KOSAKI Motohiro
2010-04-01  1:30   ` Bob Liu
2010-04-01  1:39     ` KOSAKI Motohiro
2010-04-01 13:42       ` Bob Liu

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