Skip to content

Commit 025b779

Browse files
ZhangPengakpm00
authored andcommitted
mm/memcg: remove return value of mem_cgroup_scan_tasks()
No user checks the return value of mem_cgroup_scan_tasks(). Make the return value void. Link: https://lkml.kernel.org/r/20230616063030.977586-1-zhangpeng362@huawei.com Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Nanyong Sun <sunnanyong@huawei.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Shakeel Butt <shakeelb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent aa13779 commit 025b779

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

include/linux/memcontrol.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,8 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *,
820820
struct mem_cgroup *,
821821
struct mem_cgroup_reclaim_cookie *);
822822
void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *);
823-
int mem_cgroup_scan_tasks(struct mem_cgroup *,
824-
int (*)(struct task_struct *, void *), void *);
823+
void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
824+
int (*)(struct task_struct *, void *), void *arg);
825825

826826
static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)
827827
{
@@ -1364,10 +1364,9 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root,
13641364
{
13651365
}
13661366

1367-
static inline int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
1367+
static inline void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
13681368
int (*fn)(struct task_struct *, void *), void *arg)
13691369
{
1370-
return 0;
13711370
}
13721371

13731372
static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)

mm/memcontrol.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,13 +1259,13 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg)
12591259
*
12601260
* This function iterates over tasks attached to @memcg or to any of its
12611261
* descendants and calls @fn for each task. If @fn returns a non-zero
1262-
* value, the function breaks the iteration loop and returns the value.
1263-
* Otherwise, it will iterate over all tasks and return 0.
1262+
* value, the function breaks the iteration loop. Otherwise, it will iterate
1263+
* over all tasks and return 0.
12641264
*
12651265
* This function must not be called for the root memory cgroup.
12661266
*/
1267-
int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
1268-
int (*fn)(struct task_struct *, void *), void *arg)
1267+
void mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
1268+
int (*fn)(struct task_struct *, void *), void *arg)
12691269
{
12701270
struct mem_cgroup *iter;
12711271
int ret = 0;
@@ -1285,7 +1285,6 @@ int mem_cgroup_scan_tasks(struct mem_cgroup *memcg,
12851285
break;
12861286
}
12871287
}
1288-
return ret;
12891288
}
12901289

12911290
#ifdef CONFIG_DEBUG_VM

0 commit comments

Comments
 (0)