Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm, compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

Only mm_compaction_isolate_{free, migrate}pages may be used when
CONFIG_COMPACTION is not set. All others are used only when
CONFIG_COMPACTION is set.

After this change, if CONFIG_COMPACTION is not set, the tracepoints that
only work when CONFIG_COMPACTION is set will not be exposed to userspace.
Without this change, they will always be exposed in debugfs whether
CONFIG_COMPACTION is set or not. This is an improvement.

Link: http://lkml.kernel.org/r/1552440403-11780-1-git-send-email-laoar.shao@gmail.com
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Yafang Shao and committed by
Linus Torvalds
b6cfab7a b1746b99

+2 -4
+2 -4
include/trace/events/compaction.h
··· 64 64 TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) 65 65 ); 66 66 67 + #ifdef CONFIG_COMPACTION 67 68 TRACE_EVENT(mm_compaction_migratepages, 68 69 69 70 TP_PROTO(unsigned long nr_all, ··· 133 132 __entry->sync ? "sync" : "async") 134 133 ); 135 134 136 - #ifdef CONFIG_COMPACTION 137 135 TRACE_EVENT(mm_compaction_end, 138 136 TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn, 139 137 unsigned long free_pfn, unsigned long zone_end, bool sync, ··· 166 166 __entry->sync ? "sync" : "async", 167 167 __print_symbolic(__entry->status, COMPACTION_STATUS)) 168 168 ); 169 - #endif 170 169 171 170 TRACE_EVENT(mm_compaction_try_to_compact_pages, 172 171 ··· 194 195 __entry->prio) 195 196 ); 196 197 197 - #ifdef CONFIG_COMPACTION 198 198 DECLARE_EVENT_CLASS(mm_compaction_suitable_template, 199 199 200 200 TP_PROTO(struct zone *zone, ··· 294 296 295 297 TP_ARGS(zone, order) 296 298 ); 297 - #endif 298 299 299 300 TRACE_EVENT(mm_compaction_kcompactd_sleep, 300 301 ··· 349 352 350 353 TP_ARGS(nid, order, classzone_idx) 351 354 ); 355 + #endif 352 356 353 357 #endif /* _TRACE_COMPACTION_H */ 354 358