summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h14
-rw-r--r--include/trace/events/process_reclaim.h85
2 files changed, 99 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a56812f21657..cbe9b794c714 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2329,5 +2329,19 @@ void __init setup_nr_node_ids(void);
static inline void setup_nr_node_ids(void) {}
#endif
+#ifdef CONFIG_PROCESS_RECLAIM
+struct reclaim_param {
+ struct vm_area_struct *vma;
+ /* Number of pages scanned */
+ int nr_scanned;
+ /* max pages to reclaim */
+ int nr_to_reclaim;
+ /* pages reclaimed */
+ int nr_reclaimed;
+};
+extern struct reclaim_param reclaim_task_anon(struct task_struct *task,
+ int nr_to_reclaim);
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
diff --git a/include/trace/events/process_reclaim.h b/include/trace/events/process_reclaim.h
new file mode 100644
index 000000000000..6fcede793747
--- /dev/null
+++ b/include/trace/events/process_reclaim.h
@@ -0,0 +1,85 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM process_reclaim
+
+#if !defined(_TRACE_EVENT_PROCESSRECLAIM_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_EVENT_PROCESSRECLAIM_H
+
+#include <linux/tracepoint.h>
+#include <linux/types.h>
+#include <linux/sched.h>
+
+TRACE_EVENT(process_reclaim,
+
+ TP_PROTO(int tasksize,
+ short oom_score_adj,
+ int nr_scanned, int nr_reclaimed,
+ int per_swap_size, int total_sz,
+ int nr_to_reclaim),
+
+ TP_ARGS(tasksize, oom_score_adj, nr_scanned,
+ nr_reclaimed, per_swap_size,
+ total_sz, nr_to_reclaim),
+
+ TP_STRUCT__entry(
+ __field(int, tasksize)
+ __field(short, oom_score_adj)
+ __field(int, nr_scanned)
+ __field(int, nr_reclaimed)
+ __field(int, per_swap_size)
+ __field(int, total_sz)
+ __field(int, nr_to_reclaim)
+ ),
+
+ TP_fast_assign(
+ __entry->tasksize = tasksize;
+ __entry->oom_score_adj = oom_score_adj;
+ __entry->nr_scanned = nr_scanned;
+ __entry->nr_reclaimed = nr_reclaimed;
+ __entry->per_swap_size = per_swap_size;
+ __entry->total_sz = total_sz;
+ __entry->nr_to_reclaim = nr_to_reclaim;
+ ),
+
+ TP_printk("%d, %hd, %d, %d, %d, %d, %d",
+ __entry->tasksize, __entry->oom_score_adj,
+ __entry->nr_scanned, __entry->nr_reclaimed,
+ __entry->per_swap_size, __entry->total_sz,
+ __entry->nr_to_reclaim)
+);
+
+TRACE_EVENT(process_reclaim_eff,
+
+ TP_PROTO(int efficiency, int reclaim_avg_efficiency),
+
+ TP_ARGS(efficiency, reclaim_avg_efficiency),
+
+ TP_STRUCT__entry(
+ __field(int, efficiency)
+ __field(int, reclaim_avg_efficiency)
+ ),
+
+ TP_fast_assign(
+ __entry->efficiency = efficiency;
+ __entry->reclaim_avg_efficiency = reclaim_avg_efficiency;
+ ),
+
+ TP_printk("%d, %d", __entry->efficiency,
+ __entry->reclaim_avg_efficiency)
+);
+
+#endif
+
+#include <trace/define_trace.h>
+