Fix: use struct reclaim_stat in mm_vmscan_lru_shrink_inactive for 4.17
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 Fix: use struct reclaim_stat in mm_vmscan_lru_shrink_inactive for 4.17
See upstream commit:
commit d51d1e64500fcb48fc6a18c77c965b8f48a175f2
Author: Steven Rostedt <[email protected]>
Date: Tue Apr 10 16:28:07 2018 -0700
mm, vmscan, tracing: use pointer to reclaim_stat struct in trace event
The trace event trace_mm_vmscan_lru_shrink_inactive() currently has 12 parameters! Seven of them are from the reclaim_stat structure. This structure is currently local to mm/vmscan.c. By moving it to the global vmstat.h header, we can also reference it from the vmscan tracepoints. In moving it, it brings down the overhead of passing so many arguments to the trace event. In the future, we may limit the number of arguments that a trace event may pass (ideally just 6, but more realistically it may be 8).
--- instrumentation/events/lttng-module/mm_vmscan.h | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
instrumentation/events/lttng-module/mm_vmscan.h +25 -1
@@ -550,7 +550,31 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, )#endif -#if (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,11 ,0 )) +#if (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,17 ,0 )) +LTTNG_TRACEPOINT_EVENT (mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + struct reclaim_stat *stat, int priority, int file), + +TP_ARGS (nid, nr_scanned, nr_reclaimed, stat, priority, file), + +TP_FIELDS ( + ctf_integer(int, nid, nid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) + ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) + ctf_integer(unsigned long, nr_congested, stat->nr_congested) + ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) + ctf_integer(unsigned long, nr_activate, stat->nr_activate) + ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) + ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) + ctf_integer(int, priority, priority) +ctf_integer (int, reclaim_flags,trace_shrink_flags (file)) + ) +) +#elif (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,11 ,0 )) LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, TP_PROTO(int nid,
Signature · 6 lines
2.7.4 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
PATCH 3/3 Fix: sunrpc instrumentation for 4.17
In reply to a message not in the archiveSee upstream commit:
commit e671edb9428c8a61662aaf8c39f5edced7cc45c7
Author: Chuck Lever <[email protected]>
Date: Fri Mar 16 10:33:44 2018 -0400
sunrpc: Simplify synopsis of some trace points
Clean up: struct rpc_task carries a pointer to a struct rpc_clnt, and in fact task->tk_client is always what is passed into trace points that are already passing @task.
--- instrumentation/events/lttng-module/rpc.h | 88 +++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+)
instrumentation/events/lttng-module/rpc.h +88 -0
@@ -33,6 +33,93 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, TP_ARGS(task) ) +#if (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,17 ,0 )) +LTTNG_TRACEPOINT_EVENT (rpc_connect_status, + TP_PROTO(const struct rpc_task *task), + +TP_ARGS (task), + +TP_FIELDS ( + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) +ctf_integer (int, status, task->tk_status) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS (rpc_task_running, + + TP_PROTO(const struct rpc_task *task, const void *action), + +TP_ARGS (task, action), + +TP_FIELDS ( + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE (rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_task *task, const void *action), + +TP_ARGS (task, action) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE (rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_task *task, const void *action), + +TP_ARGS (task, action) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE (rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_task *task, const void *action), + +TP_ARGS (task, action) + +) + +LTTNG_TRACEPOINT_EVENT_CLASS (rpc_task_queued, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + +TP_ARGS (task, q), + +TP_FIELDS ( + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) +ctf_string (q_name,rpc_qname (q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE (rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + +TP_ARGS (task, q) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE (rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + +TP_ARGS (task, q) + +) + +#else LTTNG_TRACEPOINT_EVENT(rpc_connect_status, TP_PROTO(struct rpc_task *task, int status),
@@ -117,6 +204,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, TP_ARGS(clnt, task, q) ) +#endif #endif /* LTTNG_TRACE_RPC_H */
Signature · 6 lines
2.7.4 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [PATCH lttng-modules 1/3] Fix: Add gfp_flags arg to mm_vmscan_kswapd_wake for 4.17
In reply to a message not in the archiveAll 3 patches merged into master, 2.10, 2.9, thanks!
Mathieu
Quoted 64 lines · ----- On Apr 17, 2018, at 11:07 AM, Michael Jeanson [email protected] wrote:
See upstream commit:
commit
5ecd9d403ad081ed2de7b118c1e96124d4e0ba6c
Author: David Rientjes <[email protected]>
Date: Thu Apr 5 16:25:16 2018 -0700mm,
page_alloc: wakeup kcompactd even if kswapd cannot free more memoryKswapd will not wakeup if per-zone watermarks are not failing or if too many previous attempts at background reclaim have failed.
This can be true if there is a lot of free memory available. For high- order allocations, kswapd is responsible for waking up kcompactd for background compaction. If the zone is not below its watermarks or reclaim has recently failed (lots of free memory, nothing left to reclaim), kcompactd does not get woken up.
When
__GFP_DIRECT_RECLAIMis not allowed, allow kcompactd to still be woken up even if kswapd will not reclaim. This allows high-order allocations, such as thp, to still trigger background compaction even when the zone has an abundance of free memory.Signed-off-by Michael Jeanson <[email protected]>---
instrumentation/events/lttng-module/mm_vmscan.h| 16 ++++++++++++++++1 file changed, 16 insertions(+)instrumentation/events/lttng-module/mm_vmscan.h +16
-1@@ -84,6 +84,21 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake,#endif +#if (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,17 ,0 )) +LTTNG_TRACEPOINT_EVENT (mm_vmscan_wakeup_kswapd, + + TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), + +TP_ARGS (nid, zid, order, gfp_flags), + +TP_FIELDS ( + ctf_integer(int, nid, nid) + ctf_integer(int, zid, zid) + ctf_integer(int, order, order) +ctf_integer (gfp_t, gfp_flags, gfp_flags) + ) +) +#else LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, TP_PROTO(int nid, int zid, int order),@@ -96,6 +111,7 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, ctf_integer(int, order, order) ) ) +#endif #if (LINUX_VERSION_CODE >=KERNEL_VERSION (4 ,8 ,0 )) --2.7.4
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev