diff mbox series

mm: memcontrol: correct the comment of mem_cgroup_unmark_under_oom()

Message ID 20200916131927.11340-1-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series mm: memcontrol: correct the comment of mem_cgroup_unmark_under_oom() | expand

Commit Message

Miaohe Lin Sept. 16, 2020, 1:19 p.m. UTC
Since commit fb2a6fc56be6 ("mm: memcg: rework and document OOM waiting and
wakeup"), we have renamed mem_cgroup_oom_lock to mem_cgroup_oom_trylock. So
replace mem_cgroup_oom_lock with mem_cgroup_oom_trylock in comment.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Hocko Sept. 16, 2020, 2:53 p.m. UTC | #1
On Wed 16-09-20 09:19:27, Miaohe Lin wrote:
> Since commit fb2a6fc56be6 ("mm: memcg: rework and document OOM waiting and
> wakeup"), we have renamed mem_cgroup_oom_lock to mem_cgroup_oom_trylock. So
> replace mem_cgroup_oom_lock with mem_cgroup_oom_trylock in comment.

While you are right I find the comment more confusing then helpful.
What does it try to tell us actually? Is it still valid? Shouldn't we
rather remove it or make it more clear?
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memcontrol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 3d26b4b954e2..702aa4d7ebbc 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1846,7 +1846,7 @@ static void mem_cgroup_unmark_under_oom(struct mem_cgroup *memcg)
>  
>  	/*
>  	 * When a new child is created while the hierarchy is under oom,
> -	 * mem_cgroup_oom_lock() may not be called. Watch for underflow.
> +	 * mem_cgroup_oom_trylock() may not be called. Watch for underflow.
>  	 */
>  	spin_lock(&memcg_oom_lock);
>  	for_each_mem_cgroup_tree(iter, memcg)
> -- 
> 2.19.1
diff mbox series

Patch

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3d26b4b954e2..702aa4d7ebbc 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1846,7 +1846,7 @@  static void mem_cgroup_unmark_under_oom(struct mem_cgroup *memcg)
 
 	/*
 	 * When a new child is created while the hierarchy is under oom,
-	 * mem_cgroup_oom_lock() may not be called. Watch for underflow.
+	 * mem_cgroup_oom_trylock() may not be called. Watch for underflow.
 	 */
 	spin_lock(&memcg_oom_lock);
 	for_each_mem_cgroup_tree(iter, memcg)