aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_isolation.c
diff options
context:
space:
mode:
authorLuden <luden@ghostmail.com>2016-02-13 23:54:06 +0100
committerZiyan <jaraidaniel@gmail.com>2016-05-01 23:35:56 +0200
commitc3f47a7451568ae3d3e33f75666fc37439794223 (patch)
tree3149c6015cd4157361a44d0fa863464d68d9be9d /mm/page_isolation.c
parentab26843c057773f42f5b46e4e4a519b39707253e (diff)
downloadkernel_samsung_tuna-c3f47a7451568ae3d3e33f75666fc37439794223.zip
kernel_samsung_tuna-c3f47a7451568ae3d3e33f75666fc37439794223.tar.gz
kernel_samsung_tuna-c3f47a7451568ae3d3e33f75666fc37439794223.tar.bz2
Extra CMA debugging code.
Added extra CMA debugging logging into FS, compaction, isolation and migration code. This makes it easier to see which parts of the kernel are responsible for the most migration failures.
Diffstat (limited to 'mm/page_isolation.c')
-rw-r--r--mm/page_isolation.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index c9f0477..fbf6f75 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -5,8 +5,19 @@
#include <linux/mm.h>
#include <linux/page-isolation.h>
#include <linux/pageblock-flags.h>
+#include <linux/ksm.h>
#include "internal.h"
+#ifdef CONFIG_CMA_DEBUG_VERBOSE
+void print_cma_page_stats(struct page *page)
+{
+ pr_err("page: phys = 0x%x, count = %d, order = %lu, private = %ld\n", page_to_phys(page), page_count(page), page_order(page), page_private(page));
+ pr_err("page: buddy = %d, LRU = %d, KSM = %d, mapping = 0x%p, map count = %d\n", PageBuddy(page), PageLRU(page), PageKsm(page), page->mapping, atomic_read(&page->_mapcount));
+ pr_err("page: index = 0x%lx, anon = %d, writeback = %d, dirty = %d, swap cache = %d\n", page->index, PageAnon(page), PageWriteback(page), PageDirty(page), PageSwapCache(page));
+ pr_err("pageblock: migratetype = 0x%x, flags = 0x%lx\n", get_pageblock_migratetype(page), get_pageblock_flags(page));
+}
+#endif
+
static inline struct page *
__first_valid_page(unsigned long pfn, unsigned long nr_pages)
{
@@ -108,8 +119,12 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn)
else
break;
}
- if (pfn < end_pfn)
+ if (pfn < end_pfn) {
+#ifdef CONFIG_CMA_DEBUG_VERBOSE
+ print_cma_page_stats(pfn_to_page(pfn));
+#endif
return 0;
+ }
return 1;
}