Skip to content

Commit 22a027e

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
SUNRPC: Add trace event when alloc_pages_bulk() makes no progress
This is an operational low memory situation that needs to be flagged. The new tracepoint records a timestamp and the nfsd thread that failed to allocate pages. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 45f1358 commit 22a027e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/trace/events/sunrpc.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,24 @@ TRACE_EVENT(svc_wake_up,
18591859
TP_printk("pid=%d", __entry->pid)
18601860
);
18611861

1862+
TRACE_EVENT(svc_alloc_arg_err,
1863+
TP_PROTO(
1864+
unsigned int pages
1865+
),
1866+
1867+
TP_ARGS(pages),
1868+
1869+
TP_STRUCT__entry(
1870+
__field(unsigned int, pages)
1871+
),
1872+
1873+
TP_fast_assign(
1874+
__entry->pages = pages;
1875+
),
1876+
1877+
TP_printk("pages=%u", __entry->pages)
1878+
);
1879+
18621880
TRACE_EVENT(svc_handle_xprt,
18631881
TP_PROTO(struct svc_xprt *xprt, int len),
18641882

net/sunrpc/svc_xprt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
687687
set_current_state(TASK_RUNNING);
688688
return -EINTR;
689689
}
690+
trace_svc_alloc_arg_err(pages);
690691
schedule_timeout(msecs_to_jiffies(500));
691692
}
692693
rqstp->rq_page_end = &rqstp->rq_pages[pages];

0 commit comments

Comments
 (0)