[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230616021955.872413-1-zhangpeng362@huawei.com>
Date: Fri, 16 Jun 2023 10:19:55 +0800
From: Peng Zhang <zhangpeng362@...wei.com>
To: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC: <hannes@...xchg.org>, <mhocko@...nel.org>,
<roman.gushchin@...ux.dev>, <shakeelb@...gle.com>,
<muchun.song@...ux.dev>, <akpm@...ux-foundation.org>,
<wangkefeng.wang@...wei.com>, <sunnanyong@...wei.com>,
ZhangPeng <zhangpeng362@...wei.com>
Subject: [PATCH] mm/memcg: remove return value of mem_cgroup_scan_tasks()
From: ZhangPeng <zhangpeng362@...wei.com>
No user checks the return value of mem_cgroup_scan_tasks(). Make the
return value void.
Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
---
include/linux/memcontrol.h | 6 +++---
mm/memcontrol.c | 9 ++++-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 7738d8c0fa4f..c20375a77c07 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -820,8 +820,8 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *,
struct mem_cgroup *,
struct mem_cgroup_reclaim_cookie *);
void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *);
-int mem_cgroup_scan_tasks(struct mem_cgroup *,
- int (*)(struct task_struct *, void *), void *);
+void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
+ int (*)(struct task_struct *, void *), void *arg);
static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)
{
@@ -1366,7 +1366,7 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root,
{
}
-static inline int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
+static inline void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
int (*fn)(struct task_struct *, void *), void *arg)
{
return 0;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0fe39ed857db..92a553b06f7a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1259,13 +1259,13 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg)
*
* This function iterates over tasks attached to @memcg or to any of its
* descendants and calls @fn for each task. If @fn returns a non-zero
- * value, the function breaks the iteration loop and returns the value.
- * Otherwise, it will iterate over all tasks and return 0.
+ * value, the function breaks the iteration loop. Otherwise, it will iterate
+ * over all tasks and return 0.
*
* This function must not be called for the root memory cgroup.
*/
-int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
- int (*fn)(struct task_struct *, void *), void *arg)
+void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
+ int (*fn)(struct task_struct *, void *), void *arg)
{
struct mem_cgroup *iter;
int ret = 0;
@@ -1285,7 +1285,6 @@ int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
break;
}
}
- return ret;
}
#ifdef CONFIG_DEBUG_VM
--
2.25.1
Powered by blists - more mailing lists