diff mbox series

mm: memcontrol: Set the correct memcg swappiness restriction

Message ID d77469b90c45c49953ccbc51e54a1d465bc18f70.1627626255.git.baolin.wang@linux.alibaba.com (mailing list archive)
State New
Headers show
Series mm: memcontrol: Set the correct memcg swappiness restriction | expand

Commit Message

Baolin Wang July 30, 2021, 6:26 a.m. UTC
Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming
anon over the file workingset") has expended the swappiness value to
make swap to be preferred in some systems. We should also change the
memcg swappiness restriction to allow memcg swap-preferred.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Hocko July 30, 2021, 6:39 a.m. UTC | #1
On Fri 30-07-21 14:26:35, Baolin Wang wrote:
> Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming
> anon over the file workingset") has expended the swappiness value to
> make swap to be preferred in some systems. We should also change the
> memcg swappiness restriction to allow memcg swap-preferred.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Yes, this looks like an omission. It doesn't really make sense to have
two different constrains on the value.

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

> ---
>  mm/memcontrol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 6580c23..988fc94 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4046,7 +4046,7 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
>  {
>  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
>  
> -	if (val > 100)
> +	if (val > 200)
>  		return -EINVAL;
>  
>  	if (!mem_cgroup_is_root(memcg))
> -- 
> 1.8.3.1
Vlastimil Babka Aug. 3, 2021, 3:20 p.m. UTC | #2
On 7/30/21 8:39 AM, Michal Hocko wrote:
> On Fri 30-07-21 14:26:35, Baolin Wang wrote:
>> Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming
>> anon over the file workingset") has expended the swappiness value to
>> make swap to be preferred in some systems. We should also change the
>> memcg swappiness restriction to allow memcg swap-preferred.
>> 
>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> 
> Yes, this looks like an omission. It doesn't really make sense to have
> two different constrains on the value.
> 
> Acked-by: Michal Hocko <mhocko@suse.com>

So, also Fixes: c843966c556d ("mm: allow swappiness that prefers reclaiming anon
over the file workingset")
?

> Thanks!
> 
>> ---
>>  mm/memcontrol.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 6580c23..988fc94 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -4046,7 +4046,7 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
>>  {
>>  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
>>  
>> -	if (val > 100)
>> +	if (val > 200)
>>  		return -EINVAL;
>>  
>>  	if (!mem_cgroup_is_root(memcg))
>> -- 
>> 1.8.3.1
>
Baolin Wang Aug. 3, 2021, 3:45 p.m. UTC | #3
On 2021/8/3 23:20, Vlastimil Babka wrote:
> On 7/30/21 8:39 AM, Michal Hocko wrote:
>> On Fri 30-07-21 14:26:35, Baolin Wang wrote:
>>> Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming
>>> anon over the file workingset") has expended the swappiness value to
>>> make swap to be preferred in some systems. We should also change the
>>> memcg swappiness restriction to allow memcg swap-preferred.
>>>
>>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
>>
>> Yes, this looks like an omission. It doesn't really make sense to have
>> two different constrains on the value.
>>
>> Acked-by: Michal Hocko <mhocko@suse.com>
> 
> So, also Fixes: c843966c556d ("mm: allow swappiness that prefers reclaiming anon
> over the file workingset")
> ?

Sure. Andrew, do I need resend it with adding fixes tag, or you can help 
to add it? Thanks.
Andrew Morton Aug. 3, 2021, 8:25 p.m. UTC | #4
On Tue, 3 Aug 2021 23:45:20 +0800 Baolin Wang <baolin.wang@linux.alibaba.com> wrote:

> > So, also Fixes: c843966c556d ("mm: allow swappiness that prefers reclaiming anon
> > over the file workingset")
> > ?
> 
> Sure. Andrew, do I need resend it with adding fixes tag, or you can help 
> to add it? Thanks.

I added the Fixes tag, thanks.
diff mbox series

Patch

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6580c23..988fc94 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4046,7 +4046,7 @@  static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
 
-	if (val > 100)
+	if (val > 200)
 		return -EINVAL;
 
 	if (!mem_cgroup_is_root(memcg))