diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2014-02-14 19:34:17 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-03-20 17:43:52 +0900 |
commit | 68f19cbeccfc48523f118394d154f2df3431b889 (patch) | |
tree | ba07f106868fc054a4b61069af5d1ea45e2bb07b /include | |
parent | 10d282f12d57a467a83a32d6163430557d631f09 (diff) | |
download | linux-3.10-68f19cbeccfc48523f118394d154f2df3431b889.tar.gz linux-3.10-68f19cbeccfc48523f118394d154f2df3431b889.tar.bz2 linux-3.10-68f19cbeccfc48523f118394d154f2df3431b889.zip |
mm/page_alloc: fix freeing of MIGRATE_RESERVE migratetype pages
Pages allocated from MIGRATE_RESERVE migratetype pageblocks
are not freed back to MIGRATE_RESERVE migratetype free
lists in free_pcppages_bulk()->__free_one_page() if we got
to free_pcppages_bulk() through drain_[zone_]pages().
The freeing through free_hot_cold_page() is okay because
freepage migratetype is set to pageblock migratetype before
calling free_pcppages_bulk(). If pages of MIGRATE_RESERVE
migratetype end up on the free lists of other migratetype
whole Reserved pageblock may be later changed to the other
migratetype in __rmqueue_fallback() and it will be never
changed back to be a Reserved pageblock. Fix the issue by
preserving freepage migratetype as a pageblock migratetype
(instead of overriding it to the requested migratetype)
for MIGRATE_RESERVE migratetype pages in rmqueue_bulk().
The problem was introduced in v2.6.31 by commit ed0ae21
("page allocator: do not call get_pageblock_migratetype()
more than necessary").
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reported-by: Yong-Taek Lee <ytk.lee@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I1d4ab2a3241387160dd376b0ead864cd2b0c59f0
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mmzone.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5c76737d836..dc40e42e685 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -63,6 +63,11 @@ enum { MIGRATE_TYPES }; +static inline bool is_migrate_reserve(int migratetype) +{ + return unlikely(migratetype == MIGRATE_RESERVE); +} + #ifdef CONFIG_CMA # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) #else |