All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Do not use arbitrary large movablecore to calculate kernelcore
@ 2015-03-29  3:36 Zhihui Zhang
  2015-04-01 23:00 ` Mel Gorman
  0 siblings, 1 reply; 3+ messages in thread
From: Zhihui Zhang @ 2015-03-29  3:36 UTC (permalink / raw)
  To: akpm, mgorman; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Do not use arbitrary large movablecore to calculate kernelcore
  2015-03-29  3:36 [PATCH] Do not use arbitrary large movablecore to calculate kernelcore Zhihui Zhang
@ 2015-04-01 23:00 ` Mel Gorman
  2015-04-03  1:21   ` Zhihui Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Mel Gorman @ 2015-04-01 23:00 UTC (permalink / raw)
  To: Zhihui Zhang; +Cc: akpm, linux-kernel

On Sat, Mar 28, 2015 at 11:36:02PM -0400, Zhihui Zhang wrote:
> 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>

I'm confused. What bug is this patch fixing? What is the user-visible
impcat of the patch?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Do not use arbitrary large movablecore to calculate kernelcore
  2015-04-01 23:00 ` Mel Gorman
@ 2015-04-03  1:21   ` Zhihui Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Zhihui Zhang @ 2015-04-03  1:21 UTC (permalink / raw)
  To: Mel Gorman; +Cc: Andrew Morton, linux-kernel

If you specify movablecore > totalpages, required_kernelcore will end
up with a big number because corepages is an unsigned integer. If so,
the following nested is a waste of time. But I see your point.

-Zhihui

On Wed, Apr 1, 2015 at 7:00 PM, Mel Gorman <mgorman@suse.de> wrote:
> On Sat, Mar 28, 2015 at 11:36:02PM -0400, Zhihui Zhang wrote:
>> 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>
>
> I'm confused. What bug is this patch fixing? What is the user-visible
> impcat of the patch?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-03  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-29  3:36 [PATCH] Do not use arbitrary large movablecore to calculate kernelcore Zhihui Zhang
2015-04-01 23:00 ` Mel Gorman
2015-04-03  1:21   ` Zhihui Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.