All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix set pageblock migratetype when boot
@ 2015-06-26 10:09 ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-06-26 10:09 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Mel Gorman, Johannes Weiner,
	iamjoonsoo.kim, David Rientjes, sasha.levin
  Cc: Linux MM, LKML, Xishi Qiu

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


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

* [PATCH] mm: fix set pageblock migratetype when boot
@ 2015-06-26 10:09 ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-06-26 10:09 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Mel Gorman, Johannes Weiner,
	iamjoonsoo.kim, David Rientjes, sasha.levin
  Cc: Linux MM, LKML, Xishi Qiu

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

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

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

* Re: [PATCH] mm: fix set pageblock migratetype when boot
  2015-06-26 10:09 ` Xishi Qiu
@ 2015-06-26 11:04   ` Mel Gorman
  -1 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2015-06-26 11:04 UTC (permalink / raw)
  To: Xishi Qiu
  Cc: Andrew Morton, Vlastimil Babka, Johannes Weiner, iamjoonsoo.kim,
	David Rientjes, sasha.levin, Linux MM, LKML

On Fri, Jun 26, 2015 at 06:09:05PM +0800, Xishi Qiu wrote:
> 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.

What important impact does that have? It should leave a partial pageblock
as MIGRATE_UNMOVABLE which is fine by me.

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

It's a lot of additional overhead to add to memory initialisation. It
would need to be for an excellent reason with no alternative solution.

-- 
Mel Gorman
SUSE Labs

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

* Re: [PATCH] mm: fix set pageblock migratetype when boot
@ 2015-06-26 11:04   ` Mel Gorman
  0 siblings, 0 replies; 6+ messages in thread
From: Mel Gorman @ 2015-06-26 11:04 UTC (permalink / raw)
  To: Xishi Qiu
  Cc: Andrew Morton, Vlastimil Babka, Johannes Weiner, iamjoonsoo.kim,
	David Rientjes, sasha.levin, Linux MM, LKML

On Fri, Jun 26, 2015 at 06:09:05PM +0800, Xishi Qiu wrote:
> 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.

What important impact does that have? It should leave a partial pageblock
as MIGRATE_UNMOVABLE which is fine by me.

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

It's a lot of additional overhead to add to memory initialisation. It
would need to be for an excellent reason with no alternative solution.

-- 
Mel Gorman
SUSE Labs

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

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

* Re: [PATCH] mm: fix set pageblock migratetype when boot
  2015-06-26 11:04   ` Mel Gorman
@ 2015-06-26 11:25     ` Xishi Qiu
  -1 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-06-26 11:25 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Andrew Morton, Vlastimil Babka, Johannes Weiner, iamjoonsoo.kim,
	David Rientjes, sasha.levin, Linux MM, LKML

On 2015/6/26 19:04, Mel Gorman wrote:

> On Fri, Jun 26, 2015 at 06:09:05PM +0800, Xishi Qiu wrote:
>> 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.
> 
> What important impact does that have? It should leave a partial pageblock
> as MIGRATE_UNMOVABLE which is fine by me.
> 

Hi Mel,

The impact is less, it's OK to ignore it.

Thanks,
Xishi Qiu

>> 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.
>>
> 
> It's a lot of additional overhead to add to memory initialisation. It
> would need to be for an excellent reason with no alternative solution.
> 




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

* Re: [PATCH] mm: fix set pageblock migratetype when boot
@ 2015-06-26 11:25     ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2015-06-26 11:25 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Andrew Morton, Vlastimil Babka, Johannes Weiner, iamjoonsoo.kim,
	David Rientjes, sasha.levin, Linux MM, LKML

On 2015/6/26 19:04, Mel Gorman wrote:

> On Fri, Jun 26, 2015 at 06:09:05PM +0800, Xishi Qiu wrote:
>> 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.
> 
> What important impact does that have? It should leave a partial pageblock
> as MIGRATE_UNMOVABLE which is fine by me.
> 

Hi Mel,

The impact is less, it's OK to ignore it.

Thanks,
Xishi Qiu

>> 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.
>>
> 
> It's a lot of additional overhead to add to memory initialisation. It
> would need to be for an excellent reason with no alternative solution.
> 



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

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

end of thread, other threads:[~2015-06-26 11:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 10:09 [PATCH] mm: fix set pageblock migratetype when boot Xishi Qiu
2015-06-26 10:09 ` Xishi Qiu
2015-06-26 11:04 ` Mel Gorman
2015-06-26 11:04   ` Mel Gorman
2015-06-26 11:25   ` Xishi Qiu
2015-06-26 11:25     ` Xishi Qiu

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.