diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2012-10-08 19:31:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 03:22:44 -0400 |
commit | 770c8aaaf6f04a87e6765f24d497132de9152a46 (patch) | |
tree | c93d594ad97750bee9115778ddc160e0414c342a /mm/page_alloc.c | |
parent | 02c6de8d757cb32c0829a45d81c3dfcbcafd998b (diff) |
mm: fix tracing in free_pcppages_bulk()
page->private gets re-used in __free_one_page() to store page order
(so trace_mm_page_pcpu_drain() may print order instead of migratetype)
thus migratetype value must be cached locally.
Fixes regression introduced in commit a7016235a61d ("mm: fix migratetype
bug which slowed swapping"). This caused incorrect data to be attached
to the mm_page_pcpu_drain trace event.
[akpm@linux-foundation.org: add comment]
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cefd14e6dcf2..3f18a14effb8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -668,12 +668,15 @@ static void free_pcppages_bulk(struct zone *zone, int count, | |||
668 | batch_free = to_free; | 668 | batch_free = to_free; |
669 | 669 | ||
670 | do { | 670 | do { |
671 | int mt; /* migratetype of the to-be-freed page */ | ||
672 | |||
671 | page = list_entry(list->prev, struct page, lru); | 673 | page = list_entry(list->prev, struct page, lru); |
672 | /* must delete as __free_one_page list manipulates */ | 674 | /* must delete as __free_one_page list manipulates */ |
673 | list_del(&page->lru); | 675 | list_del(&page->lru); |
676 | mt = page_private(page); | ||
674 | /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */ | 677 | /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */ |
675 | __free_one_page(page, zone, 0, page_private(page)); | 678 | __free_one_page(page, zone, 0, mt); |
676 | trace_mm_page_pcpu_drain(page, 0, page_private(page)); | 679 | trace_mm_page_pcpu_drain(page, 0, mt); |
677 | } while (--to_free && --batch_free && !list_empty(list)); | 680 | } while (--to_free && --batch_free && !list_empty(list)); |
678 | } | 681 | } |
679 | __mod_zone_page_state(zone, NR_FREE_PAGES, count); | 682 | __mod_zone_page_state(zone, NR_FREE_PAGES, count); |