linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip()
@ 2012-10-09 11:43 Bartlomiej Zolnierkiewicz
  2012-10-09 13:46 ` Minchan Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2012-10-09 11:43 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Minchan Kim, Thierry Reding, Peter Ujfalusi,
	Marek Szyprowski, Michal Nazarewicz, Mark Brown, Kyungmin Park,
	linux-mm

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip() 

{get,clear,set}_pageblock_skip() use incorrect bit ranges (please compare
to bit ranges used by {get,set}_pageblock_flags() used for migration types)
and can overwrite pageblock migratetype of the next pageblock in the bitmap.

This fix is needed for "mm: compaction: cache if a pageblock was scanned and
no pages were isolated" patch.

Acked-by: Mel Gorman <mgorman@suse.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Andrew, please apply.

 include/linux/pageblock-flags.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: b/include/linux/pageblock-flags.h
===================================================================
--- a/include/linux/pageblock-flags.h	2012-10-09 12:50:20.366340001 +0200
+++ b/include/linux/pageblock-flags.h	2012-10-09 12:50:31.794339996 +0200
@@ -71,13 +71,13 @@ void set_pageblock_flags_group(struct pa
 #ifdef CONFIG_COMPACTION
 #define get_pageblock_skip(page) \
 			get_pageblock_flags_group(page, PB_migrate_skip,     \
-							PB_migrate_skip + 1)
+							PB_migrate_skip)
 #define clear_pageblock_skip(page) \
 			set_pageblock_flags_group(page, 0, PB_migrate_skip,  \
-							PB_migrate_skip + 1)
+							PB_migrate_skip)
 #define set_pageblock_skip(page) \
 			set_pageblock_flags_group(page, 1, PB_migrate_skip,  \
-							PB_migrate_skip + 1)
+							PB_migrate_skip)
 #endif /* CONFIG_COMPACTION */
 
 #define get_pageblock_flags(page) \

--
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] 2+ messages in thread

* Re: [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip()
  2012-10-09 11:43 [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip() Bartlomiej Zolnierkiewicz
@ 2012-10-09 13:46 ` Minchan Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Minchan Kim @ 2012-10-09 13:46 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Andrew Morton, Mel Gorman, Thierry Reding, Peter Ujfalusi,
	Marek Szyprowski, Michal Nazarewicz, Mark Brown, Kyungmin Park,
	linux-mm

On Tue, Oct 09, 2012 at 01:43:47PM +0200, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Subject: [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip() 
> 
> {get,clear,set}_pageblock_skip() use incorrect bit ranges (please compare
> to bit ranges used by {get,set}_pageblock_flags() used for migration types)
> and can overwrite pageblock migratetype of the next pageblock in the bitmap.
> 
> This fix is needed for "mm: compaction: cache if a pageblock was scanned and
> no pages were isolated" patch.
> 
> Acked-by: Mel Gorman <mgorman@suse.de>
> Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Michal Nazarewicz <mina86@mina86.com>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>

Good spot. Thanks, Bart!

-- 
Kind Regards,
Minchan Kim

--
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] 2+ messages in thread

end of thread, other threads:[~2012-10-09 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 11:43 [PATCH] mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip() Bartlomiej Zolnierkiewicz
2012-10-09 13:46 ` Minchan Kim

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