* [PATCH] mm: memcontrol: Remove task_in_mem_cgroup().
@ 2019-06-18 10:02 Tetsuo Handa
2019-06-18 12:36 ` Michal Hocko
0 siblings, 1 reply; 3+ messages in thread
From: Tetsuo Handa @ 2019-06-18 10:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Tetsuo Handa, David Rientjes, Shakeel Butt
oom_unkillable_task() no longer calls task_in_mem_cgroup().
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: David Rientjes <rientjes@google.com>
---
include/linux/memcontrol.h | 7 -------
mm/memcontrol.c | 26 --------------------------
2 files changed, 33 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 1dcb763..dcc5785 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -392,7 +392,6 @@ static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
struct lruvec *mem_cgroup_page_lruvec(struct page *, struct pglist_data *);
-bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg);
struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm);
@@ -870,12 +869,6 @@ static inline bool mm_match_cgroup(struct mm_struct *mm,
return true;
}
-static inline bool task_in_mem_cgroup(struct task_struct *task,
- const struct mem_cgroup *memcg)
-{
- return true;
-}
-
static inline struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)
{
return NULL;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b09ff45..0b17c77 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1255,32 +1255,6 @@ void mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru,
*lru_size += nr_pages;
}
-bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg)
-{
- struct mem_cgroup *task_memcg;
- struct task_struct *p;
- bool ret;
-
- p = find_lock_task_mm(task);
- if (p) {
- task_memcg = get_mem_cgroup_from_mm(p->mm);
- task_unlock(p);
- } else {
- /*
- * All threads may have already detached their mm's, but the oom
- * killer still needs to detect if they have already been oom
- * killed to prevent needlessly killing additional tasks.
- */
- rcu_read_lock();
- task_memcg = mem_cgroup_from_task(task);
- css_get(&task_memcg->css);
- rcu_read_unlock();
- }
- ret = mem_cgroup_is_descendant(task_memcg, memcg);
- css_put(&task_memcg->css);
- return ret;
-}
-
/**
* mem_cgroup_margin - calculate chargeable space of a memory cgroup
* @memcg: the memory cgroup
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: memcontrol: Remove task_in_mem_cgroup().
2019-06-18 10:02 [PATCH] mm: memcontrol: Remove task_in_mem_cgroup() Tetsuo Handa
@ 2019-06-18 12:36 ` Michal Hocko
2019-06-18 13:26 ` Tetsuo Handa
0 siblings, 1 reply; 3+ messages in thread
From: Michal Hocko @ 2019-06-18 12:36 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: Andrew Morton, linux-mm, David Rientjes, Shakeel Butt
On Tue 18-06-19 19:02:34, Tetsuo Handa wrote:
> oom_unkillable_task() no longer calls task_in_mem_cgroup().
This was indeed the last caller of this function which got me surprised.
Let's fold this into the refactoring patch.
Thanks!
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: Shakeel Butt <shakeelb@google.com>
> Cc: David Rientjes <rientjes@google.com>
> ---
> include/linux/memcontrol.h | 7 -------
> mm/memcontrol.c | 26 --------------------------
> 2 files changed, 33 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 1dcb763..dcc5785 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -392,7 +392,6 @@ static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
>
> struct lruvec *mem_cgroup_page_lruvec(struct page *, struct pglist_data *);
>
> -bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg);
> struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
>
> struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm);
> @@ -870,12 +869,6 @@ static inline bool mm_match_cgroup(struct mm_struct *mm,
> return true;
> }
>
> -static inline bool task_in_mem_cgroup(struct task_struct *task,
> - const struct mem_cgroup *memcg)
> -{
> - return true;
> -}
> -
> static inline struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)
> {
> return NULL;
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index b09ff45..0b17c77 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1255,32 +1255,6 @@ void mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru,
> *lru_size += nr_pages;
> }
>
> -bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg)
> -{
> - struct mem_cgroup *task_memcg;
> - struct task_struct *p;
> - bool ret;
> -
> - p = find_lock_task_mm(task);
> - if (p) {
> - task_memcg = get_mem_cgroup_from_mm(p->mm);
> - task_unlock(p);
> - } else {
> - /*
> - * All threads may have already detached their mm's, but the oom
> - * killer still needs to detect if they have already been oom
> - * killed to prevent needlessly killing additional tasks.
> - */
> - rcu_read_lock();
> - task_memcg = mem_cgroup_from_task(task);
> - css_get(&task_memcg->css);
> - rcu_read_unlock();
> - }
> - ret = mem_cgroup_is_descendant(task_memcg, memcg);
> - css_put(&task_memcg->css);
> - return ret;
> -}
> -
> /**
> * mem_cgroup_margin - calculate chargeable space of a memory cgroup
> * @memcg: the memory cgroup
> --
> 1.8.3.1
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: memcontrol: Remove task_in_mem_cgroup().
2019-06-18 12:36 ` Michal Hocko
@ 2019-06-18 13:26 ` Tetsuo Handa
0 siblings, 0 replies; 3+ messages in thread
From: Tetsuo Handa @ 2019-06-18 13:26 UTC (permalink / raw)
To: Michal Hocko; +Cc: Andrew Morton, linux-mm, David Rientjes, Shakeel Butt
On 2019/06/18 21:36, Michal Hocko wrote:
> On Tue 18-06-19 19:02:34, Tetsuo Handa wrote:
>> oom_unkillable_task() no longer calls task_in_mem_cgroup().
>
> This was indeed the last caller of this function which got me surprised.
> Let's fold this into the refactoring patch.
>
> Thanks!
OK. Please fold into "mm, oom: fix oom_unkillable_task for memcg OOMs".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-18 13:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 10:02 [PATCH] mm: memcontrol: Remove task_in_mem_cgroup() Tetsuo Handa
2019-06-18 12:36 ` Michal Hocko
2019-06-18 13:26 ` Tetsuo Handa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).