Commit 770c8aaa authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds
Browse files

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 a7016235

 ("mm: fix migratetype
bug which slowed swapping").  This caused incorrect data to be attached
to the mm_page_pcpu_drain trace event.

[ add comment]
Cc: Marek Szyprowski <>
Cc: Michal Nazarewicz <>
Acked-by: default avatarMinchan Kim <>
Acked-by: default avatarMel Gorman <>
Cc: Hugh Dickins <>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <>
Signed-off-by: default avatarKyungmin Park <>
Acked-by: default avatarKOSAKI Motohiro <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 02c6de8d
......@@ -668,12 +668,15 @@ static void free_pcppages_bulk(struct zone *zone, int count,
batch_free = to_free;
do {
int mt; /* migratetype of the to-be-freed page */
page = list_entry(list->prev, struct page, lru);
/* must delete as __free_one_page list manipulates */
mt = page_private(page);
__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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment