From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: rientjes@google.com, hannes@cmpxchg.org, mhocko@kernel.org,
vdavydov@virtuozzo.com
Cc: linux-mm@kvack.org, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Subject: [PATCH] mm: memcontrol: Pass NULL memcg for oom_badness() check.
Date: Fri, 19 Feb 2016 22:51:38 +0900 [thread overview]
Message-ID: <1455889898-5659-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> (raw)
Currently, mem_cgroup_out_of_memory() is calling
oom_scan_process_thread(&oc, task, totalpages) which includes
a call to oom_unkillable_task(task, NULL, NULL) and then is
calling oom_badness(task, memcg, NULL, totalpages) which includes
a call to oom_unkillable_task(task, memcg, NULL).
Since for_each_mem_cgroup_tree() iterates on only tasks from the given
memcg hierarchy, there is no point with passing non-NULL memcg argument
to oom_unkillable_task() via oom_badness().
Replace memcg argument with NULL in order to save a call to
task_in_mem_cgroup(task, memcg) in oom_unkillable_task()
which is always true.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ae8b81c..3c96dd3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1290,7 +1290,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
case OOM_SCAN_OK:
break;
};
- points = oom_badness(task, memcg, NULL, totalpages);
+ points = oom_badness(task, NULL, NULL, totalpages);
if (!points || points < chosen_points)
continue;
/* Prefer thread group leaders for display purposes */
--
1.8.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2016-02-19 13:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 13:51 Tetsuo Handa [this message]
2016-02-19 14:04 ` Michal Hocko
2016-02-19 14:36 ` Tetsuo Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455889898-5659-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp \
--to=penguin-kernel@i-love.sakura.ne.jp \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=rientjes@google.com \
--cc=vdavydov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox