LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: akpm@linux-foundation.org
Cc: kamezawa.hiroyu@jp.fujitsu.com, nishimura@mxp.nes.nec.co.jp,
balbir@linux.vnet.ibm.com, minchan.kim@gmail.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [patch 3/3] memcg: never OOM when charging huge pages
Date: Mon, 31 Jan 2011 15:03:55 +0100 [thread overview]
Message-ID: <1296482635-13421-4-git-send-email-hannes@cmpxchg.org> (raw)
In-Reply-To: <1296482635-13421-1-git-send-email-hannes@cmpxchg.org>
Huge page coverage should obviously have less priority than the
continued execution of a process.
Never kill a process when charging it a huge page fails. Instead,
give up after the first failed reclaim attempt and fall back to
regular pages.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
mm/memcontrol.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c28072f..9e5de7c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2343,13 +2343,19 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
gfp_t gfp_mask, enum charge_type ctype)
{
struct mem_cgroup *mem = NULL;
+ int page_size = PAGE_SIZE;
struct page_cgroup *pc;
+ bool oom = true;
int ret;
- int page_size = PAGE_SIZE;
if (PageTransHuge(page)) {
page_size <<= compound_order(page);
VM_BUG_ON(!PageTransHuge(page));
+ /*
+ * Never OOM-kill a process for a huge page. The
+ * fault handler will fall back to regular pages.
+ */
+ oom = false;
}
pc = lookup_page_cgroup(page);
@@ -2358,7 +2364,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
return 0;
prefetchw(pc);
- ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, true, page_size);
+ ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, oom, page_size);
if (ret || !mem)
return ret;
--
1.7.3.5
next prev parent reply other threads:[~2011-01-31 14:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 14:03 Johannes Weiner
2011-01-31 14:03 ` [patch 1/3] memcg: prevent endless loop when charging huge pages Johannes Weiner
2011-01-31 22:27 ` Minchan Kim
2011-01-31 23:48 ` KAMEZAWA Hiroyuki
2011-01-31 14:03 ` [patch 2/3] memcg: prevent endless loop when charging huge pages to near-limit group Johannes Weiner
2011-01-31 22:41 ` Andrew Morton
2011-01-31 23:50 ` KAMEZAWA Hiroyuki
2011-02-01 0:04 ` Johannes Weiner
2011-02-01 0:24 ` Andrew Morton
2011-02-01 0:34 ` Johannes Weiner
2011-02-03 12:53 ` [patch 0/2] memcg: clean up limit checking Johannes Weiner
2011-02-03 12:54 ` [patch 1/2] memcg: soft limit reclaim should end at limit not below Johannes Weiner
2011-02-03 23:41 ` KAMEZAWA Hiroyuki
2011-02-04 4:10 ` Balbir Singh
2011-02-03 12:56 ` [patch 2/2] memcg: simplify the way memory limits are checked Johannes Weiner
2011-02-03 23:44 ` KAMEZAWA Hiroyuki
2011-02-04 4:12 ` Balbir Singh
2011-01-31 22:42 ` [patch 2/3] memcg: prevent endless loop when charging huge pages to near-limit group Minchan Kim
2011-01-31 14:03 ` Johannes Weiner [this message]
2011-01-31 22:52 ` [patch 3/3] memcg: never OOM when charging huge pages Minchan Kim
2011-01-31 23:51 ` KAMEZAWA Hiroyuki
-- strict thread matches above, loose matches on Subject: below --
2011-01-21 6:34 [PATCH 0/7] memcg : more fixes and clean up for 2.6.28-rc KAMEZAWA Hiroyuki
2011-01-21 6:44 ` [PATCH 4/7] memcg : fix charge function of THP allocation KAMEZAWA Hiroyuki
2011-01-27 10:34 ` Johannes Weiner
2011-01-27 13:47 ` [patch 3/3] memcg: never OOM when charging huge pages Johannes Weiner
2011-01-27 23:44 ` KAMEZAWA Hiroyuki
2011-01-27 23:45 ` Daisuke Nishimura
2011-01-27 23:49 ` KAMEZAWA Hiroyuki
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=1296482635-13421-4-git-send-email-hannes@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=nishimura@mxp.nes.nec.co.jp \
--subject='Re: [patch 3/3] memcg: never OOM when charging huge pages' \
/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
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).