Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565518 > unrolled thread

[PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value

Started byJia He <hejianet@gmail.com>
First post2017-01-24 08:50 +0100
Last post2017-01-25 03:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value Jia He <hejianet@gmail.com> - 2017-01-24 08:50 +0100
    Re: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return  value Rik van Riel <riel@redhat.com> - 2017-01-24 23:10 +0100
      Re: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return  value hejianet <hejianet@gmail.com> - 2017-01-25 03:30 +0100

#1565518 — [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value

FromJia He <hejianet@gmail.com>
Date2017-01-24 08:50 +0100
Subject[PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value
Message-ID<t341z-1po-1@gated-at.bofh.it>
When there is no reclaimable pages in the zone, even the zone is
not balanced, we let kswapd go sleeping. That is prepare_kswapd_sleep
will return true in this case.

Signed-off-by: Jia He <hejianet@gmail.com>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7396a0a..54445e2 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3140,7 +3140,8 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, int classzone_idx)
 		if (!managed_zone(zone))
 			continue;
 
-		if (!zone_balanced(zone, order, classzone_idx))
+		if (!zone_balanced(zone, order, classzone_idx)
+			&& !zone_reclaimable_pages(zone))
 			return false;
 	}
 
-- 
2.5.5

[toc] | [next] | [standalone]


#1566191 — Re: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value

FromRik van Riel <riel@redhat.com>
Date2017-01-24 23:10 +0100
SubjectRe: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value
Message-ID<t3hrQ-1E3-7@gated-at.bofh.it>
In reply to#1565518
On Tue, 2017-01-24 at 15:49 +0800, Jia He wrote:
> When there is no reclaimable pages in the zone, even the zone is
> not balanced, we let kswapd go sleeping. That is prepare_kswapd_sleep
> will return true in this case.
> 
> Signed-off-by: Jia He <hejianet@gmail.com>
> ---
>  mm/vmscan.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 7396a0a..54445e2 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -3140,7 +3140,8 @@ static bool prepare_kswapd_sleep(pg_data_t
> *pgdat, int order, int classzone_idx)
>  		if (!managed_zone(zone))
>  			continue;
>  
> -		if (!zone_balanced(zone, order, classzone_idx))
> +		if (!zone_balanced(zone, order, classzone_idx)
> +			&& !zone_reclaimable_pages(zone))
>  			return false;
>  	}

This patch does the opposite of what your changelog
says.  The above keeps kswapd running forever if
the zone is not balanced, and there are no reclaimable
pages.

[toc] | [prev] | [next] | [standalone]


#1566281 — Re: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value

Fromhejianet <hejianet@gmail.com>
Date2017-01-25 03:30 +0100
SubjectRe: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value
Message-ID<t3lvr-47m-5@gated-at.bofh.it>
In reply to#1566191

On 25/01/2017 6:01 AM, Rik van Riel wrote:
> On Tue, 2017-01-24 at 15:49 +0800, Jia He wrote:
>> When there is no reclaimable pages in the zone, even the zone is
>> not balanced, we let kswapd go sleeping. That is prepare_kswapd_sleep
>> will return true in this case.
>>
>> Signed-off-by: Jia He <hejianet@gmail.com>
>> ---
>>  mm/vmscan.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 7396a0a..54445e2 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -3140,7 +3140,8 @@ static bool prepare_kswapd_sleep(pg_data_t
>> *pgdat, int order, int classzone_idx)
>>  		if (!managed_zone(zone))
>>  			continue;
>>
>> -		if (!zone_balanced(zone, order, classzone_idx))
>> +		if (!zone_balanced(zone, order, classzone_idx)
>> +			&& !zone_reclaimable_pages(zone))
>>  			return false;
>>  	}
>
> This patch does the opposite of what your changelog
> says.  The above keeps kswapd running forever if
> the zone is not balanced, and there are no reclaimable
> pages.
sorry for the mistake, I will check what happened.
I tested in my local system.

B.R.
Jia
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web