[PATCH] fix: decrease NR_FREE_PAGES when isolate page from buddy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "minkyung88.kim" <minkyung88.kim@xxxxxxx>

NR_FREEPAGE should be decreased when pages are isolated from buddy.
Therefore fix the count.

Signed-off-by: minkyung88.kim <minkyung88.kim@xxxxxxx>
---
 mm/page_isolation.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 303c908..16cc172 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -233,10 +233,14 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
 			 */
 			if (get_freepage_migratetype(page) != MIGRATE_ISOLATE) {
 				struct page *end_page;
+				struct zone *zone = page_zone(page);
+				int mt = get_freepage_migratetype(page);
+				unsigned long nr_pages;
 
 				end_page = page + (1 << page_order(page)) - 1;
-				move_freepages(page_zone(page), page, end_page,
+				nr_pages = move_freepages(zone, page, end_page,
 						MIGRATE_ISOLATE);
+				__mod_zone_freepage_state(zone, -nr_pages, mt);
 			}
 			pfn += 1 << page_order(page);
 		}
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]