linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix: decrease NR_FREE_PAGES when isolate page from buddy
@ 2015-07-01  1:17 minkyung88.kim
  2015-07-02  9:52 ` Vlastimil Babka
  0 siblings, 1 reply; 19+ messages in thread
From: minkyung88.kim @ 2015-07-01  1:17 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: Seungho Park, kmk3210, minkyung88.kim

From: "minkyung88.kim" <minkyung88.kim@lge.com>

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

Signed-off-by: minkyung88.kim <minkyung88.kim@lge.com>
---
 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@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-07-30 14:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01  1:17 [PATCH] fix: decrease NR_FREE_PAGES when isolate page from buddy minkyung88.kim
2015-07-02  9:52 ` Vlastimil Babka
2015-07-03  7:15   ` "김민경/주임연구원/SW Platform(연)AOT팀(minkyung88.kim@lge.com)"
2015-07-03 14:11     ` Vlastimil Babka
2015-07-21 12:53       ` [PATCH 1/2] mm, page_isolation: remove bogus tests for isolated pages Vlastimil Babka
2015-07-21 12:53         ` [PATCH 2/2] mm: rename and move get/set_freepage_migratetype Vlastimil Babka
2015-07-21 22:47           ` David Rientjes
2015-07-22 12:29           ` Vlastimil Babka
2015-07-23  5:24             ` Joonsoo Kim
2015-07-23  6:48             ` Naoya Horiguchi
2015-07-29 13:57             ` Mel Gorman
2015-07-30 14:08             ` Michal Nazarewicz
2015-07-21 22:43         ` [PATCH 1/2] mm, page_isolation: remove bogus tests for isolated pages David Rientjes
2015-07-22 12:25           ` Vlastimil Babka
2015-07-22 21:42             ` David Rientjes
2015-07-23  5:23         ` Joonsoo Kim
2015-07-23  5:41         ` Naoya Horiguchi
2015-07-29 13:55         ` Mel Gorman
2015-07-30 14:07         ` Michal Nazarewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).