diff options
-rw-r--r-- | include/trace/events/compaction.h | 30 | ||||
-rw-r--r-- | mm/compaction.c | 9 |
2 files changed, 29 insertions, 10 deletions
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 839f6fac921a..139020b55612 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h | |||
@@ -11,39 +11,55 @@ | |||
11 | 11 | ||
12 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, | 12 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, |
13 | 13 | ||
14 | TP_PROTO(unsigned long nr_scanned, | 14 | TP_PROTO( |
15 | unsigned long start_pfn, | ||
16 | unsigned long end_pfn, | ||
17 | unsigned long nr_scanned, | ||
15 | unsigned long nr_taken), | 18 | unsigned long nr_taken), |
16 | 19 | ||
17 | TP_ARGS(nr_scanned, nr_taken), | 20 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken), |
18 | 21 | ||
19 | TP_STRUCT__entry( | 22 | TP_STRUCT__entry( |
23 | __field(unsigned long, start_pfn) | ||
24 | __field(unsigned long, end_pfn) | ||
20 | __field(unsigned long, nr_scanned) | 25 | __field(unsigned long, nr_scanned) |
21 | __field(unsigned long, nr_taken) | 26 | __field(unsigned long, nr_taken) |
22 | ), | 27 | ), |
23 | 28 | ||
24 | TP_fast_assign( | 29 | TP_fast_assign( |
30 | __entry->start_pfn = start_pfn; | ||
31 | __entry->end_pfn = end_pfn; | ||
25 | __entry->nr_scanned = nr_scanned; | 32 | __entry->nr_scanned = nr_scanned; |
26 | __entry->nr_taken = nr_taken; | 33 | __entry->nr_taken = nr_taken; |
27 | ), | 34 | ), |
28 | 35 | ||
29 | TP_printk("nr_scanned=%lu nr_taken=%lu", | 36 | TP_printk("range=(0x%lx ~ 0x%lx) nr_scanned=%lu nr_taken=%lu", |
37 | __entry->start_pfn, | ||
38 | __entry->end_pfn, | ||
30 | __entry->nr_scanned, | 39 | __entry->nr_scanned, |
31 | __entry->nr_taken) | 40 | __entry->nr_taken) |
32 | ); | 41 | ); |
33 | 42 | ||
34 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, | 43 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages, |
35 | 44 | ||
36 | TP_PROTO(unsigned long nr_scanned, | 45 | TP_PROTO( |
46 | unsigned long start_pfn, | ||
47 | unsigned long end_pfn, | ||
48 | unsigned long nr_scanned, | ||
37 | unsigned long nr_taken), | 49 | unsigned long nr_taken), |
38 | 50 | ||
39 | TP_ARGS(nr_scanned, nr_taken) | 51 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) |
40 | ); | 52 | ); |
41 | 53 | ||
42 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, | 54 | DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, |
43 | TP_PROTO(unsigned long nr_scanned, | 55 | |
56 | TP_PROTO( | ||
57 | unsigned long start_pfn, | ||
58 | unsigned long end_pfn, | ||
59 | unsigned long nr_scanned, | ||
44 | unsigned long nr_taken), | 60 | unsigned long nr_taken), |
45 | 61 | ||
46 | TP_ARGS(nr_scanned, nr_taken) | 62 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) |
47 | ); | 63 | ); |
48 | 64 | ||
49 | TRACE_EVENT(mm_compaction_migratepages, | 65 | TRACE_EVENT(mm_compaction_migratepages, |
diff --git a/mm/compaction.c b/mm/compaction.c index 66f7c365e888..b12df9fe10b4 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -430,11 +430,12 @@ isolate_fail: | |||
430 | 430 | ||
431 | } | 431 | } |
432 | 432 | ||
433 | trace_mm_compaction_isolate_freepages(*start_pfn, blockpfn, | ||
434 | nr_scanned, total_isolated); | ||
435 | |||
433 | /* Record how far we have got within the block */ | 436 | /* Record how far we have got within the block */ |
434 | *start_pfn = blockpfn; | 437 | *start_pfn = blockpfn; |
435 | 438 | ||
436 | trace_mm_compaction_isolate_freepages(nr_scanned, total_isolated); | ||
437 | |||
438 | /* | 439 | /* |
439 | * If strict isolation is requested by CMA then check that all the | 440 | * If strict isolation is requested by CMA then check that all the |
440 | * pages requested were isolated. If there were any failures, 0 is | 441 | * 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 | unsigned long flags = 0; | 591 | unsigned long flags = 0; |
591 | bool locked = false; | 592 | bool locked = false; |
592 | struct page *page = NULL, *valid_page = NULL; | 593 | struct page *page = NULL, *valid_page = NULL; |
594 | unsigned long start_pfn = low_pfn; | ||
593 | 595 | ||
594 | /* | 596 | /* |
595 | * Ensure that there are not too many pages isolated from the LRU | 597 | * Ensure that there are not too many pages isolated from the LRU |
@@ -750,7 +752,8 @@ isolate_success: | |||
750 | if (low_pfn == end_pfn) | 752 | if (low_pfn == end_pfn) |
751 | update_pageblock_skip(cc, valid_page, nr_isolated, true); | 753 | update_pageblock_skip(cc, valid_page, nr_isolated, true); |
752 | 754 | ||
753 | trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); | 755 | trace_mm_compaction_isolate_migratepages(start_pfn, low_pfn, |
756 | nr_scanned, nr_isolated); | ||
754 | 757 | ||
755 | count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned); | 758 | count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned); |
756 | if (nr_isolated) | 759 | if (nr_isolated) |