Commit e34d85f0 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm/compaction: print current range where compaction work

It'd be useful to know current range where compaction work for detailed
analysis.  With it, we can know pageblock where we actually scan and
isolate, and, how much pages we try in that pageblock and can guess why it
doesn't become freepage with pageblock order roughly.
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 16c4a097
...@@ -11,39 +11,55 @@ ...@@ -11,39 +11,55 @@
DECLARE_EVENT_CLASS(mm_compaction_isolate_template, DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
TP_PROTO(unsigned long nr_scanned, TP_PROTO(
unsigned long start_pfn,
unsigned long end_pfn,
unsigned long nr_scanned,
unsigned long nr_taken), unsigned long nr_taken),
TP_ARGS(nr_scanned, nr_taken), TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned long, start_pfn)
__field(unsigned long, end_pfn)
__field(unsigned long, nr_scanned) __field(unsigned long, nr_scanned)
__field(unsigned long, nr_taken) __field(unsigned long, nr_taken)
), ),
TP_fast_assign( TP_fast_assign(
__entry->start_pfn = start_pfn;
__entry->end_pfn = end_pfn;
__entry->nr_scanned = nr_scanned; __entry->nr_scanned = nr_scanned;
__entry->nr_taken = nr_taken; __entry->nr_taken = nr_taken;
), ),
TP_printk("nr_scanned=%lu nr_taken=%lu", TP_printk("range=(0x%lx ~ 0x%lx) nr_scanned=%lu nr_taken=%lu",
__entry->start_pfn,
__entry->end_pfn,
__entry->nr_scanned, __entry->nr_scanned,
__entry->nr_taken) __entry->nr_taken)
); );
DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages,
TP_PROTO(unsigned long nr_scanned, TP_PROTO(
unsigned long start_pfn,
unsigned long end_pfn,
unsigned long nr_scanned,
unsigned long nr_taken), unsigned long nr_taken),
TP_ARGS(nr_scanned, nr_taken) TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
); );
DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
TP_PROTO(unsigned long nr_scanned,
TP_PROTO(
unsigned long start_pfn,
unsigned long end_pfn,
unsigned long nr_scanned,
unsigned long nr_taken), unsigned long nr_taken),
TP_ARGS(nr_scanned, nr_taken) TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
); );
TRACE_EVENT(mm_compaction_migratepages, TRACE_EVENT(mm_compaction_migratepages,
......
...@@ -430,11 +430,12 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, ...@@ -430,11 +430,12 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
} }
trace_mm_compaction_isolate_freepages(*start_pfn, blockpfn,
nr_scanned, total_isolated);
/* Record how far we have got within the block */ /* Record how far we have got within the block */
*start_pfn = blockpfn; *start_pfn = blockpfn;
trace_mm_compaction_isolate_freepages(nr_scanned, total_isolated);
/* /*
* If strict isolation is requested by CMA then check that all the * If strict isolation is requested by CMA then check that all the
* pages requested were isolated. If there were any failures, 0 is * pages requested were isolated. If there were any failures, 0 is
...@@ -590,6 +591,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, ...@@ -590,6 +591,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
unsigned long flags = 0; unsigned long flags = 0;
bool locked = false; bool locked = false;
struct page *page = NULL, *valid_page = NULL; struct page *page = NULL, *valid_page = NULL;
unsigned long start_pfn = low_pfn;
/* /*
* Ensure that there are not too many pages isolated from the LRU * Ensure that there are not too many pages isolated from the LRU
...@@ -750,7 +752,8 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, ...@@ -750,7 +752,8 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
if (low_pfn == end_pfn) if (low_pfn == end_pfn)
update_pageblock_skip(cc, valid_page, nr_isolated, true); update_pageblock_skip(cc, valid_page, nr_isolated, true);
trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); trace_mm_compaction_isolate_migratepages(start_pfn, low_pfn,
nr_scanned, nr_isolated);
count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned); count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned);
if (nr_isolated) if (nr_isolated)
......
Markdown is supported
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