linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Jerome Marchand" <jmarchan@redhat.com>
To: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>
Cc: cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] mm: memcontrol: fix order calculation in try_charge()
Date: Tue, 15 Sep 2015 14:05:57 +0200	[thread overview]
Message-ID: <1442318757-7141-1-git-send-email-jmarchan@redhat.com> (raw)

Since commit <6539cc05386> (mm: memcontrol: fold mem_cgroup_do_charge()),
the order to pass to mem_cgroup_oom() is calculated by passing the number
of pages to get_order() instead of the expected  size in bytes. AFAICT,
it only affects the value displayed in the oom warning message.
This patch fix this.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
 mm/memcontrol.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 1742a2d..91bf094 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2032,7 +2032,8 @@ retry:
 
 	mem_cgroup_events(mem_over_limit, MEMCG_OOM, 1);
 
-	mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(nr_pages));
+	mem_cgroup_oom(mem_over_limit, gfp_mask,
+		       get_order(nr_pages * PAGE_SIZE));
 nomem:
 	if (!(gfp_mask & __GFP_NOFAIL))
 		return -ENOMEM;
-- 
1.9.3

--
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>

             reply	other threads:[~2015-09-15 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 12:05 Jerome Marchand [this message]
2015-09-15 13:56 ` [PATCH] mm: memcontrol: fix order calculation in try_charge() Michal Hocko
2015-09-17 13:04   ` Michal Hocko
2015-09-18  7:42 ` Johannes Weiner

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=1442318757-7141-1-git-send-email-jmarchan@redhat.com \
    --to=jmarchan@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).