2024-05-09 03:33:37

by Xiu Jianfeng

[permalink] [raw]
Subject: [PATCH -next] memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order

Since commit 857f21397f71 ("memcg, oom: remove unnecessary check in
mem_cgroup_oom_synchronize()"), memcg_oom_gfp_mask and memcg_oom_order
are no longer used any more.

Signed-off-by: Xiu Jianfeng <[email protected]>
---
include/linux/sched.h | 2 --
mm/memcontrol.c | 2 --
2 files changed, 4 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8d1cf672ac4c..61591ac6eab6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1449,8 +1449,6 @@ struct task_struct {

#ifdef CONFIG_MEMCG
struct mem_cgroup *memcg_in_oom;
- gfp_t memcg_oom_gfp_mask;
- int memcg_oom_order;

/* Number of pages to reclaim on returning to userland: */
unsigned int memcg_nr_pages_over_high;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5d4da23264fa..d127c9c5fabf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2192,8 +2192,6 @@ static bool mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
if (current->in_user_fault) {
css_get(&memcg->css);
current->memcg_in_oom = memcg;
- current->memcg_oom_gfp_mask = mask;
- current->memcg_oom_order = order;
}
return false;
}
--
2.34.1



2024-05-09 19:40:11

by Roman Gushchin

[permalink] [raw]
Subject: Re: [PATCH -next] memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order

On Thu, May 09, 2024 at 03:26:28AM +0000, Xiu Jianfeng wrote:
> Since commit 857f21397f71 ("memcg, oom: remove unnecessary check in
> mem_cgroup_oom_synchronize()"), memcg_oom_gfp_mask and memcg_oom_order
> are no longer used any more.
>
> Signed-off-by: Xiu Jianfeng <[email protected]>

Good catch!

Reviewed-by: Roman Gushchin <[email protected]>

Thanks

2024-05-09 21:28:09

by Shakeel Butt

[permalink] [raw]
Subject: Re: [PATCH -next] memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order

On Thu, May 09, 2024 at 03:26:28AM +0000, Xiu Jianfeng wrote:
> Since commit 857f21397f71 ("memcg, oom: remove unnecessary check in
> mem_cgroup_oom_synchronize()"), memcg_oom_gfp_mask and memcg_oom_order
> are no longer used any more.
>
> Signed-off-by: Xiu Jianfeng <[email protected]>

Acked-by: Shakeel Butt <[email protected]>

2024-05-10 11:57:53

by Michal Hocko

[permalink] [raw]
Subject: Re: [PATCH -next] memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order

On Thu 09-05-24 03:26:28, Xiu Jianfeng wrote:
> Since commit 857f21397f71 ("memcg, oom: remove unnecessary check in
> mem_cgroup_oom_synchronize()"), memcg_oom_gfp_mask and memcg_oom_order
> are no longer used any more.
>
> Signed-off-by: Xiu Jianfeng <[email protected]>

Acked-by: Michal Hocko <[email protected]>

Thanks!
> ---
> include/linux/sched.h | 2 --
> mm/memcontrol.c | 2 --
> 2 files changed, 4 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 8d1cf672ac4c..61591ac6eab6 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1449,8 +1449,6 @@ struct task_struct {
>
> #ifdef CONFIG_MEMCG
> struct mem_cgroup *memcg_in_oom;
> - gfp_t memcg_oom_gfp_mask;
> - int memcg_oom_order;
>
> /* Number of pages to reclaim on returning to userland: */
> unsigned int memcg_nr_pages_over_high;
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 5d4da23264fa..d127c9c5fabf 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2192,8 +2192,6 @@ static bool mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
> if (current->in_user_fault) {
> css_get(&memcg->css);
> current->memcg_in_oom = memcg;
> - current->memcg_oom_gfp_mask = mask;
> - current->memcg_oom_order = order;
> }
> return false;
> }
> --
> 2.34.1

--
Michal Hocko
SUSE Labs