From patchwork Thu Nov 21 23:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11257041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F6C813A4 for ; Thu, 21 Nov 2019 23:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DA72206D7 for ; Thu, 21 Nov 2019 23:29:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fguTswre" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbfKUX35 (ORCPT ); Thu, 21 Nov 2019 18:29:57 -0500 Received: from mail-io1-f41.google.com ([209.85.166.41]:38924 "EHLO mail-io1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfKUX35 (ORCPT ); Thu, 21 Nov 2019 18:29:57 -0500 Received: by mail-io1-f41.google.com with SMTP id k1so5594873ioj.6 for ; Thu, 21 Nov 2019 15:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=BGK3nktBWdQF19efdzCopVrZpMUHW7hGUEQVypCgK4Y=; b=fguTswreFq+OmTH4/PZGTIDWQbWIJDgcc5G4IG3xPF6Ca2SXTJwdp8Y+eY93gu/Og4 5Bk/B4SZKupfVDIzCvTencm81hBs9pfFBQHhgr4Aw1fTrfI3bv9xHfZPhmTQW0eV9Fev A0xO/eo7o40K8x3G65o7MGvf651xinzlbDgw6ojDneC9YJaqvrX5bfh/C2rGkcymuHny gVlSblAfch2fHKwYRoETsHA4axM3y04uLmNtQ4NkyR8TMfRfyPENmjCZX5o8ZsJeIUWm 73LlQ6E22BdGwZmRJNFHviTi+sg25YJ+NwzFigcVsUBX/f0p/8rLxk9DaOunQsHdr6PH SNlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BGK3nktBWdQF19efdzCopVrZpMUHW7hGUEQVypCgK4Y=; b=Lh3N7yLRtreJYFaRfXcAzLgpAZd/ZlSmwIlUX0Wu9v7GYdCGy3rGiDyynU7rO12p2j 76wQxceUIm4X78zkXwwd0+tJFrGymSw9F9Ocp5ldztTiMLemqSei+pQoxLOn7UFOinK+ SBVQp4BKeIfNjEgzWSQF5JdUK+9UUY6eQep+fj+Yc0Ilm8VRPHuMsDbN3BxXj92vL9iK m7L6yJBMrLf6iDIAGWezvj7Bgya6WGBBFpE8M+qMWm5pXx80WmM3GhKFLbp1Fz4SQIKG 2SkQcBFU9arvcbgbZTh4GJCWz4dCmU5gqvcRCBNvTz4+rqj7ExCU6Oa8J2uthaPDH11V CFkQ== X-Gm-Message-State: APjAAAWjv60/O7sQjfbqfzOEHZeFowrB8OCE6JdrDZrqvB1XA/I3nixM HXLEa+f3o6oGiHtPVviaaMo6RsJfJlh9J7CnZgM= X-Google-Smtp-Source: APXvYqxUbW1uqFJtrPlooulAB0eRHT9CqB+B68eJmz8NXO1KIhEkTWTuRZAyoHqV/DlRGbV12K0xIDq3Uyjgb0hNiAw= X-Received: by 2002:a5d:848c:: with SMTP id t12mr9617025iom.5.1574378996147; Thu, 21 Nov 2019 15:29:56 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Thu, 21 Nov 2019 17:29:45 -0600 Message-ID: Subject: [PATCH][SMB3] move num_waiters and in_send counters from CONFIG_CIFS_STAT2 to default To: ronnie sahlberg , =?utf-8?q?Aur=C3=A9lien_Apte?= =?utf-8?q?l?= , Pavel Shilovsky , CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Any objections? (Was needed for one of Aurelien's patches) From dad4639be2f430f6ddf03b5e9bcdcb4619cd5407 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 21 Nov 2019 17:26:35 -0600 Subject: [PATCH] smb3: dump in_send and num_waiters stats counters by default Number of requests in_send and the number of waiters on sendRecv are useful counters in various cases, move them from CONFIG_CIFS_STATS2 to be on by default especially with multichannel Signed-off-by: Steve French --- fs/cifs/cifs_debug.c | 3 +-- fs/cifs/cifsglob.h | 22 +++------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index c2dd07903d56..64121f34acd0 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -386,11 +386,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) server->srv_count, server->sec_mode, in_flight(server)); -#ifdef CONFIG_CIFS_STATS2 seq_printf(m, " In Send: %d In MaxReq Wait: %d", atomic_read(&server->in_send), atomic_read(&server->num_waiters)); -#endif + /* dump session id helpful for use with network trace */ seq_printf(m, " SessionId: 0x%llx", ses->Suid); if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 2fc3d77463d3..d34a4ed8c57d 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -743,12 +743,12 @@ struct TCP_Server_Info { /* Total size of this PDU. Only valid from cifs_demultiplex_thread */ unsigned int pdu_size; unsigned int total_read; /* total amount of data read in this pass */ + atomic_t in_send; /* requests trying to send */ + atomic_t num_waiters; /* blocked waiting to get in sendrecv */ #ifdef CONFIG_CIFS_FSCACHE struct fscache_cookie *fscache; /* client index cache cookie */ #endif #ifdef CONFIG_CIFS_STATS2 - atomic_t in_send; /* requests trying to send */ - atomic_t num_waiters; /* blocked waiting to get in sendrecv */ atomic_t num_cmds[NUMBER_OF_SMB2_COMMANDS]; /* total requests by cmd */ atomic_t smb2slowcmd[NUMBER_OF_SMB2_COMMANDS]; /* count resps > 1 sec */ __u64 time_per_cmd[NUMBER_OF_SMB2_COMMANDS]; /* total time per cmd */ @@ -1606,8 +1606,6 @@ struct close_cancelled_open { /* Make code in transport.c a little cleaner by moving update of optional stats into function below */ -#ifdef CONFIG_CIFS_STATS2 - static inline void cifs_in_send_inc(struct TCP_Server_Info *server) { atomic_inc(&server->in_send); @@ -1628,26 +1626,12 @@ static inline void cifs_num_waiters_dec(struct TCP_Server_Info *server) atomic_dec(&server->num_waiters); } +#ifdef CONFIG_CIFS_STATS2 static inline void cifs_save_when_sent(struct mid_q_entry *mid) { mid->when_sent = jiffies; } #else -static inline void cifs_in_send_inc(struct TCP_Server_Info *server) -{ -} -static inline void cifs_in_send_dec(struct TCP_Server_Info *server) -{ -} - -static inline void cifs_num_waiters_inc(struct TCP_Server_Info *server) -{ -} - -static inline void cifs_num_waiters_dec(struct TCP_Server_Info *server) -{ -} - static inline void cifs_save_when_sent(struct mid_q_entry *mid) { } -- 2.23.0