public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xishi Qiu <qiuxishi@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>, Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>, <iamjoonsoo.kim@lge.com>,
	David Rientjes <rientjes@google.com>, <sasha.levin@oracle.com>
Cc: Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Xishi Qiu <qiuxishi@huawei.com>
Subject: [PATCH] mm: fix set pageblock migratetype when boot
Date: Fri, 26 Jun 2015 18:09:05 +0800	[thread overview]
Message-ID: <558D24C1.5020901@huawei.com> (raw)

memmap_init_zone()
	...
	if ((z->zone_start_pfn <= pfn)
	    && (pfn < zone_end_pfn(z))
	    && !(pfn & (pageblock_nr_pages - 1)))
		set_pageblock_migratetype(page, MIGRATE_MOVABLE);
	...

If the pfn does not align to pageblock, it will not init the migratetype.
So call it for every page, it will takes more time, but it doesn't matter, 
this function will be called only in boot or hotadd memory.

e.g.
[  223.679446]   node   0: [mem 0x00001000-0x00099fff]
[  223.679449]   node   0: [mem 0x00100000-0xbf78ffff]
[  223.680486]   node   0: [mem 0x100000000-0x27fffffff]

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
 mm/page_alloc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ebffa0e..a1df227 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4210,8 +4210,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 		 * pfn out of zone.
 		 */
 		if ((z->zone_start_pfn <= pfn)
-		    && (pfn < zone_end_pfn(z))
-		    && !(pfn & (pageblock_nr_pages - 1)))
+		    && (pfn < zone_end_pfn(z)))
 			set_pageblock_migratetype(page, MIGRATE_MOVABLE);
 
 		INIT_LIST_HEAD(&page->lru);
-- 
1.7.1


             reply	other threads:[~2015-06-26 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 10:09 Xishi Qiu [this message]
2015-06-26 11:04 ` [PATCH] mm: fix set pageblock migratetype when boot Mel Gorman
2015-06-26 11:25   ` Xishi Qiu

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=558D24C1.5020901@huawei.com \
    --to=qiuxishi@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=rientjes@google.com \
    --cc=sasha.levin@oracle.com \
    --cc=vbabka@suse.cz \
    /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