smb3: add dynamic tracepoint for timeout waiting for credits

To help debug credit starvation problems where we timeout
waiting for server to grant the client credits.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
This commit is contained in:
Steve French 2019-03-09 20:29:55 -06:00
parent ffd1ef1e50
commit 7937ca961c
2 changed files with 6 additions and 0 deletions

View File

@ -713,6 +713,7 @@ DEFINE_EVENT(smb3_credit_class, smb3_##name, \
TP_ARGS(currmid, hostname, credits)) TP_ARGS(currmid, hostname, credits))
DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits); DEFINE_SMB3_CREDIT_EVENT(reconnect_with_invalid_credits);
DEFINE_SMB3_CREDIT_EVENT(credit_timeout);
#endif /* _CIFS_TRACE_H */ #endif /* _CIFS_TRACE_H */

View File

@ -527,6 +527,8 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
has_credits(server, credits, num_credits), t); has_credits(server, credits, num_credits), t);
cifs_num_waiters_dec(server); cifs_num_waiters_dec(server);
if (!rc) { if (!rc) {
trace_smb3_credit_timeout(server->CurrentMid,
server->hostname, num_credits);
cifs_dbg(VFS, "wait timed out after %d ms\n", cifs_dbg(VFS, "wait timed out after %d ms\n",
timeout); timeout);
return -ENOTSUPP; return -ENOTSUPP;
@ -565,6 +567,9 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
t); t);
cifs_num_waiters_dec(server); cifs_num_waiters_dec(server);
if (!rc) { if (!rc) {
trace_smb3_credit_timeout(
server->CurrentMid,
server->hostname, num_credits);
cifs_dbg(VFS, "wait timed out after %d ms\n", cifs_dbg(VFS, "wait timed out after %d ms\n",
timeout); timeout);
return -ENOTSUPP; return -ENOTSUPP;