From: Zhihui Zhang <zzhsuny@gmail.com>
To: akpm@linux-foundation.org, mgorman@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Do not use arbitrary large movablecore to calculate kernelcore
Date: Sat, 28 Mar 2015 23:36:02 -0400 [thread overview]
Message-ID: <1427600162-4610-1-git-send-email-zzhsuny@gmail.com> (raw)
If kernelcore is not set, then we are working with a very large kernelcore
for nothing - no movable zone will be created. If kernelcore is set,
then it is not respected at all.
Signed-off-by: Zhihui Zhang <zzhsuny@gmail.com>
---
mm/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 40e2942..32bf5da 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5199,7 +5199,11 @@ static void __init find_zone_movable_pfns_for_nodes(void)
*/
required_movablecore =
roundup(required_movablecore, MAX_ORDER_NR_PAGES);
- corepages = totalpages - required_movablecore;
+
+ if (totalpages > required_movablecore)
+ corepages = totalpages - required_movablecore;
+ else
+ corepages = 0;
required_kernelcore = max(required_kernelcore, corepages);
}
--
1.9.1
next reply other threads:[~2015-03-29 3:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 3:36 Zhihui Zhang [this message]
2015-04-01 23:00 ` Mel Gorman
2015-04-03 1:21 ` Zhihui Zhang
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=1427600162-4610-1-git-send-email-zzhsuny@gmail.com \
--to=zzhsuny@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
/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
Powered by JetHome