diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2014-11-13 18:19:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-13 19:17:06 -0500 |
commit | 57cbc87e03c2f473d8f0579186c078ee06f48f2c (patch) | |
tree | 8aa1d1aca7250f09301a312155450fa623e71e15 /mm | |
parent | 8edc6e1688fc8f02c8c1f53a2ec4928cb1055f4d (diff) |
mm/debug-pagealloc: correct freepage accounting and order resetting
One thing I did in this patch is fixing freepage accounting. If we
clear guard page and link it onto isolate buddy list, we should not
increase freepage count. This patch adds conditional branch to skip
counting in this case. Without this patch, this overcounting happens
frequently if guard order is set and CMA is used.
Another thing fixed in this patch is the target to reset order. In
__free_one_page(), we check the buddy page whether it is a guard page or
not. And, if so, we should clear guard attribute on the buddy page and
reset order of it to 0. But, current code resets original page's order
rather than buddy one's. Maybe, this doesn't have any problem, because
whole merged page's order will be re-assigned soon. But, it is better
to correct code.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Gioh Kim <gioh.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 181dc593962b..616a2c956b4b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -583,9 +583,11 @@ static inline void __free_one_page(struct page *page, | |||
583 | */ | 583 | */ |
584 | if (page_is_guard(buddy)) { | 584 | if (page_is_guard(buddy)) { |
585 | clear_page_guard_flag(buddy); | 585 | clear_page_guard_flag(buddy); |
586 | set_page_private(page, 0); | 586 | set_page_private(buddy, 0); |
587 | __mod_zone_freepage_state(zone, 1 << order, | 587 | if (!is_migrate_isolate(migratetype)) { |
588 | migratetype); | 588 | __mod_zone_freepage_state(zone, 1 << order, |
589 | migratetype); | ||
590 | } | ||
589 | } else { | 591 | } else { |
590 | list_del(&buddy->lru); | 592 | list_del(&buddy->lru); |
591 | zone->free_area[order].nr_free--; | 593 | zone->free_area[order].nr_free--; |