[PATCH] mm/memcg: fix obsolete function name in mem_cgroup_protection()

Miaohe Lin posted 1 patch 2 years, 6 months ago
There is a newer version of this series
include/linux/memcontrol.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] mm/memcg: fix obsolete function name in mem_cgroup_protection()
Posted by Miaohe Lin 2 years, 6 months ago
Commit 45c7f7e1ef17 ("mm, memcg: decouple e{low,min} state mutations from
protection checks") changed the function name but not the corresponding
comment.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 include/linux/memcontrol.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 058fb748e128..64014b656a0f 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -582,9 +582,9 @@ static inline void mem_cgroup_protection(struct mem_cgroup *root,
 	/*
 	 * There is no reclaim protection applied to a targeted reclaim.
 	 * We are special casing this specific case here because
-	 * mem_cgroup_protected calculation is not robust enough to keep
-	 * the protection invariant for calculated effective values for
-	 * parallel reclaimers with different reclaim target. This is
+	 * mem_cgroup_calculate_protection calculation is not robust enough
+	 * to keep the protection invariant for calculated effective values
+	 * for parallel reclaimers with different reclaim target. This is
 	 * especially a problem for tail memcgs (as they have pages on LRU)
 	 * which would want to have effective values 0 for targeted reclaim
 	 * but a different value for external reclaim.
-- 
2.33.0
Re: [PATCH] mm/memcg: fix obsolete function name in mem_cgroup_protection()
Posted by Matthew Wilcox 2 years, 6 months ago
On Sun, Jul 23, 2023 at 11:25:38AM +0800, Miaohe Lin wrote:
> @@ -582,9 +582,9 @@ static inline void mem_cgroup_protection(struct mem_cgroup *root,
>  	/*
>  	 * There is no reclaim protection applied to a targeted reclaim.
>  	 * We are special casing this specific case here because
> -	 * mem_cgroup_protected calculation is not robust enough to keep
> -	 * the protection invariant for calculated effective values for
> -	 * parallel reclaimers with different reclaim target. This is
> +	 * mem_cgroup_calculate_protection calculation is not robust enough
> +	 * to keep the protection invariant for calculated effective values
> +	 * for parallel reclaimers with different reclaim target. This is
>  	 * especially a problem for tail memcgs (as they have pages on LRU)
>  	 * which would want to have effective values 0 for targeted reclaim
>  	 * but a different value for external reclaim.

This reads a little awkwardly now.  How about:

 	 * We are special casing this specific case here because
-	 * mem_cgroup_protected calculation is not robust enough to keep
+	 * mem_cgroup_calculate_protection is not robust enough to keep
 	 * the protection invariant for calculated effective values for
	 * parallel reclaimers with different reclaim target. This is
Re: [PATCH] mm/memcg: fix obsolete function name in mem_cgroup_protection()
Posted by Miaohe Lin 2 years, 6 months ago
On 2023/7/24 4:37, Matthew Wilcox wrote:
> On Sun, Jul 23, 2023 at 11:25:38AM +0800, Miaohe Lin wrote:
>> @@ -582,9 +582,9 @@ static inline void mem_cgroup_protection(struct mem_cgroup *root,
>>  	/*
>>  	 * There is no reclaim protection applied to a targeted reclaim.
>>  	 * We are special casing this specific case here because
>> -	 * mem_cgroup_protected calculation is not robust enough to keep
>> -	 * the protection invariant for calculated effective values for
>> -	 * parallel reclaimers with different reclaim target. This is
>> +	 * mem_cgroup_calculate_protection calculation is not robust enough
>> +	 * to keep the protection invariant for calculated effective values
>> +	 * for parallel reclaimers with different reclaim target. This is
>>  	 * especially a problem for tail memcgs (as they have pages on LRU)
>>  	 * which would want to have effective values 0 for targeted reclaim
>>  	 * but a different value for external reclaim.
> 
> This reads a little awkwardly now.  How about:
> 
>  	 * We are special casing this specific case here because
> -	 * mem_cgroup_protected calculation is not robust enough to keep
> +	 * mem_cgroup_calculate_protection is not robust enough to keep

Sounds better. Will do it in v2.

Thanks.