]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: fix tracing in free_pcppages_bulk()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 28 Sep 2012 00:19:37 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 06:49:27 +0000 (16:49 +1000)
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 a701623 ("mm: fix migratetype bug which
slowed swapping").  This caused incorrect data to be attached to the
mm_page_pcpu_drain trace event.

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>
mm/page_alloc.c

index 028617d1ca658f3243fb625c254081cf3329b4e0..76aff40ae9c32a4dd29bdba28a6632859198e8b6 100644 (file)
@@ -667,12 +667,15 @@ static void free_pcppages_bulk(struct zone *zone, int count,
                        batch_free = to_free;
 
                do {
+                       int mt;
+
                        page = list_entry(list->prev, struct page, lru);
                        /* must delete as __free_one_page list manipulates */
                        list_del(&page->lru);
+                       mt = page_private(page);
                        /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */
-                       __free_one_page(page, zone, 0, page_private(page));
-                       trace_mm_page_pcpu_drain(page, 0, page_private(page));
+                       __free_one_page(page, zone, 0, mt);
+                       trace_mm_page_pcpu_drain(page, 0, mt);
                } while (--to_free && --batch_free && !list_empty(list));
        }
        __mod_zone_page_state(zone, NR_FREE_PAGES, count);