* [PATCH 1/2] cifs: dump channel info in DebugData
@ 2019-11-20 16:15 Aurelien Aptel
2019-11-20 16:15 ` [PATCH 2/2] cifs: try harder to open new channels Aurelien Aptel
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Aurelien Aptel @ 2019-11-20 16:15 UTC (permalink / raw)
To: linux-cifs; +Cc: smfrench, Aurelien Aptel
* show server&TCP states for extra channels
* mention if an interface has a channel connected to it
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
---
fs/cifs/cifs_debug.c | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index efb2928ff6c8..c2dd07903d56 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -121,6 +121,27 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
seq_putc(m, '\n');
}
+static void
+cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
+{
+ struct TCP_Server_Info *server = chan->server;
+
+ seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
+ "TCP status: %d Instance: %d Local Users To Server: %d "
+ "SecMode: 0x%x Req On Wire: %d In Send: %d "
+ "In MaxReq Wait: %d\n",
+ i+1,
+ server->credits,
+ server->dialect,
+ server->tcpStatus,
+ server->reconnect_instance,
+ server->srv_count,
+ server->sec_mode,
+ in_flight(server),
+ atomic_read(&server->in_send),
+ atomic_read(&server->num_waiters));
+}
+
static void
cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
{
@@ -377,6 +398,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
if (ses->sign)
seq_puts(m, " signed");
+ if (ses->chan_count > 1) {
+ seq_printf(m, "\n\n\tExtra Channels: %lu\n",
+ ses->chan_count-1);
+ for (j = 1; j < ses->chan_count; j++)
+ cifs_dump_channel(m, j, &ses->chans[j]);
+ }
+
seq_puts(m, "\n\tShares:");
j = 0;
@@ -415,8 +443,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
seq_printf(m, "\n\tServer interfaces: %zu\n",
ses->iface_count);
for (j = 0; j < ses->iface_count; j++) {
+ struct cifs_server_iface *iface;
+
+ iface = &ses->iface_list[j];
seq_printf(m, "\t%d)", j);
- cifs_dump_iface(m, &ses->iface_list[j]);
+ cifs_dump_iface(m, iface);
+ if (is_ses_using_iface(ses, iface))
+ seq_puts(m, "\t\t[CONNECTED]\n");
}
spin_unlock(&ses->iface_lock);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] cifs: try harder to open new channels
2019-11-20 16:15 [PATCH 1/2] cifs: dump channel info in DebugData Aurelien Aptel
@ 2019-11-20 16:15 ` Aurelien Aptel
2019-11-21 21:54 ` [PATCH 1/2] cifs: dump channel info in DebugData Steve French
2019-11-21 23:44 ` [PATCH 1/2] " Steve French
2 siblings, 0 replies; 6+ messages in thread
From: Aurelien Aptel @ 2019-11-20 16:15 UTC (permalink / raw)
To: linux-cifs; +Cc: smfrench, Aurelien Aptel
Previously we would only loop over the iface list once.
This patch tries to loop over multiple times until all channels are
opened. It will also try to reuse RSS ifaces.
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
---
fs/cifs/sess.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index ee6bf47b6cfe..fb3bdc44775c 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -76,6 +76,7 @@ int cifs_try_adding_channels(struct cifs_ses *ses)
int left = ses->chan_max - ses->chan_count;
int i = 0;
int rc = 0;
+ int tries = 0;
if (left <= 0) {
cifs_dbg(FYI,
@@ -89,29 +90,40 @@ int cifs_try_adding_channels(struct cifs_ses *ses)
return 0;
}
- /* ifaces are sorted by speed, try them in order */
- for (i = 0; left > 0 && i < ses->iface_count; i++) {
+ /*
+ * Keep connecting to same, fastest, iface for all channels as
+ * long as its RSS. Try next fastest one if not RSS or channel
+ * creation fails.
+ */
+ while (left > 0) {
struct cifs_server_iface *iface;
+ tries++;
+ if (tries > 3*ses->chan_max) {
+ cifs_dbg(FYI, "too many attempt at opening channels (%d channels left to open)\n",
+ left);
+ break;
+ }
+
iface = &ses->iface_list[i];
- if (is_ses_using_iface(ses, iface) && !iface->rss_capable)
+ if (is_ses_using_iface(ses, iface) && !iface->rss_capable) {
+ i = (i+1) % ses->iface_count;
continue;
+ }
rc = cifs_ses_add_channel(ses, iface);
if (rc) {
- cifs_dbg(FYI, "failed to open extra channel\n");
+ cifs_dbg(FYI, "failed to open extra channel on iface#%d rc=%d\n",
+ i, rc);
+ i = (i+1) % ses->iface_count;
continue;
}
- cifs_dbg(FYI, "successfully opened new channel\n");
+ cifs_dbg(FYI, "successfully opened new channel on iface#%d\n",
+ i);
left--;
}
- /*
- * TODO: if we still have channels left to open try to connect
- * to same RSS-capable iface multiple times
- */
-
return ses->chan_count - old_chan_count;
}
--
2.16.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] cifs: dump channel info in DebugData
2019-11-20 16:15 [PATCH 1/2] cifs: dump channel info in DebugData Aurelien Aptel
2019-11-20 16:15 ` [PATCH 2/2] cifs: try harder to open new channels Aurelien Aptel
@ 2019-11-21 21:54 ` Steve French
2019-11-25 12:16 ` [PATCH v2] " Aurelien Aptel
2019-11-21 23:44 ` [PATCH 1/2] " Steve French
2 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-11-21 21:54 UTC (permalink / raw)
To: Aurelien Aptel; +Cc: CIFS
With current for-next got:
CHECK /home/smfrench/cifs-2.6/fs/cifs/cifs_debug.c
/home/smfrench/cifs-2.6/fs/cifs/cifs_debug.c:141:39: error: no member
'in_send' in struct TCP_Server_Info
CC [M] /home/smfrench/cifs-2.6/fs/cifs/cifs_debug.o
/home/smfrench/cifs-2.6/fs/cifs/cifs_debug.c: In function ‘cifs_dump_channel’:
/home/smfrench/cifs-2.6/fs/cifs/cifs_debug.c:141:25: error: ‘struct
TCP_Server_Info’ has no member named ‘in_send’
141 | atomic_read(&server->in_send),
| ^~
/home/smfrench/cifs-2.6/fs/cifs/cifs_debug.c:142:25: error: ‘struct
TCP_Server_Info’ has no member named ‘num_waiters’
142 | atomic_read(&server->num_waiters));
On Wed, Nov 20, 2019 at 10:16 AM Aurelien Aptel <aaptel@suse.com> wrote:
>
> * show server&TCP states for extra channels
> * mention if an interface has a channel connected to it
>
> Signed-off-by: Aurelien Aptel <aaptel@suse.com>
> ---
> fs/cifs/cifs_debug.c | 35 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index efb2928ff6c8..c2dd07903d56 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -121,6 +121,27 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
> seq_putc(m, '\n');
> }
>
> +static void
> +cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
> +{
> + struct TCP_Server_Info *server = chan->server;
> +
> + seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
> + "TCP status: %d Instance: %d Local Users To Server: %d "
> + "SecMode: 0x%x Req On Wire: %d In Send: %d "
> + "In MaxReq Wait: %d\n",
> + i+1,
> + server->credits,
> + server->dialect,
> + server->tcpStatus,
> + server->reconnect_instance,
> + server->srv_count,
> + server->sec_mode,
> + in_flight(server),
> + atomic_read(&server->in_send),
> + atomic_read(&server->num_waiters));
> +}
> +
> static void
> cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
> {
> @@ -377,6 +398,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> if (ses->sign)
> seq_puts(m, " signed");
>
> + if (ses->chan_count > 1) {
> + seq_printf(m, "\n\n\tExtra Channels: %lu\n",
> + ses->chan_count-1);
> + for (j = 1; j < ses->chan_count; j++)
> + cifs_dump_channel(m, j, &ses->chans[j]);
> + }
> +
> seq_puts(m, "\n\tShares:");
> j = 0;
>
> @@ -415,8 +443,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> seq_printf(m, "\n\tServer interfaces: %zu\n",
> ses->iface_count);
> for (j = 0; j < ses->iface_count; j++) {
> + struct cifs_server_iface *iface;
> +
> + iface = &ses->iface_list[j];
> seq_printf(m, "\t%d)", j);
> - cifs_dump_iface(m, &ses->iface_list[j]);
> + cifs_dump_iface(m, iface);
> + if (is_ses_using_iface(ses, iface))
> + seq_puts(m, "\t\t[CONNECTED]\n");
> }
> spin_unlock(&ses->iface_lock);
> }
> --
> 2.16.4
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] cifs: dump channel info in DebugData
2019-11-20 16:15 [PATCH 1/2] cifs: dump channel info in DebugData Aurelien Aptel
2019-11-20 16:15 ` [PATCH 2/2] cifs: try harder to open new channels Aurelien Aptel
2019-11-21 21:54 ` [PATCH 1/2] cifs: dump channel info in DebugData Steve French
@ 2019-11-21 23:44 ` Steve French
2 siblings, 0 replies; 6+ messages in thread
From: Steve French @ 2019-11-21 23:44 UTC (permalink / raw)
To: Aurelien Aptel; +Cc: CIFS
This wouldn't build due to CONFIG_CIFS_STATS2 but I merged it and
fixed the build break by adding a followon patch which enables in_send
and num_waiters by default (not requiring CONFIG_CIFS_STATS2 for those
two counters)
On Wed, Nov 20, 2019 at 10:16 AM Aurelien Aptel <aaptel@suse.com> wrote:
>
> * show server&TCP states for extra channels
> * mention if an interface has a channel connected to it
>
> Signed-off-by: Aurelien Aptel <aaptel@suse.com>
> ---
> fs/cifs/cifs_debug.c | 35 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index efb2928ff6c8..c2dd07903d56 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -121,6 +121,27 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
> seq_putc(m, '\n');
> }
>
> +static void
> +cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
> +{
> + struct TCP_Server_Info *server = chan->server;
> +
> + seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
> + "TCP status: %d Instance: %d Local Users To Server: %d "
> + "SecMode: 0x%x Req On Wire: %d In Send: %d "
> + "In MaxReq Wait: %d\n",
> + i+1,
> + server->credits,
> + server->dialect,
> + server->tcpStatus,
> + server->reconnect_instance,
> + server->srv_count,
> + server->sec_mode,
> + in_flight(server),
> + atomic_read(&server->in_send),
> + atomic_read(&server->num_waiters));
> +}
> +
> static void
> cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
> {
> @@ -377,6 +398,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> if (ses->sign)
> seq_puts(m, " signed");
>
> + if (ses->chan_count > 1) {
> + seq_printf(m, "\n\n\tExtra Channels: %lu\n",
> + ses->chan_count-1);
> + for (j = 1; j < ses->chan_count; j++)
> + cifs_dump_channel(m, j, &ses->chans[j]);
> + }
> +
> seq_puts(m, "\n\tShares:");
> j = 0;
>
> @@ -415,8 +443,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
> seq_printf(m, "\n\tServer interfaces: %zu\n",
> ses->iface_count);
> for (j = 0; j < ses->iface_count; j++) {
> + struct cifs_server_iface *iface;
> +
> + iface = &ses->iface_list[j];
> seq_printf(m, "\t%d)", j);
> - cifs_dump_iface(m, &ses->iface_list[j]);
> + cifs_dump_iface(m, iface);
> + if (is_ses_using_iface(ses, iface))
> + seq_puts(m, "\t\t[CONNECTED]\n");
> }
> spin_unlock(&ses->iface_lock);
> }
> --
> 2.16.4
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] cifs: dump channel info in DebugData
2019-11-21 21:54 ` [PATCH 1/2] cifs: dump channel info in DebugData Steve French
@ 2019-11-25 12:16 ` Aurelien Aptel
2019-11-25 16:24 ` kbuild test robot
0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Aptel @ 2019-11-25 12:16 UTC (permalink / raw)
To: linux-cifs; +Cc: smfrench, Aurelien Aptel
* show server&TCP states for extra channels
* mention if an interface has a channel connected to it
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
---
Changes since v1:
* make it work regardless of CONFIG_CIFS_STATS2
* use %zu for printing size_t
fs/cifs/cifs_debug.c | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index efb2928ff6c8..05376bfa5938 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -121,6 +121,33 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
seq_putc(m, '\n');
}
+static void
+cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
+{
+ struct TCP_Server_Info *server = chan->server;
+
+ seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
+ "TCP status: %d Instance: %d Local Users To Server: %d "
+ "SecMode: 0x%x Req On Wire: %d"
+#ifdef CONFIG_CIFS_STATS2
+ " In Send: %d In MaxReq Wait: %d"
+#endif
+ "\n",
+ i+1,
+ server->credits,
+ server->dialect,
+ server->tcpStatus,
+ server->reconnect_instance,
+ server->srv_count,
+ server->sec_mode,
+ in_flight(server)
+#ifdef CONFIG_CIFS_STATS2
+ ,atomic_read(&server->in_send),
+ atomic_read(&server->num_waiters)
+#endif
+ );
+}
+
static void
cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
{
@@ -377,6 +404,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
if (ses->sign)
seq_puts(m, " signed");
+ if (ses->chan_count > 1) {
+ seq_printf(m, "\n\n\tExtra Channels: %zu\n",
+ ses->chan_count-1);
+ for (j = 1; j < ses->chan_count; j++)
+ cifs_dump_channel(m, j, &ses->chans[j]);
+ }
+
seq_puts(m, "\n\tShares:");
j = 0;
@@ -415,8 +449,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
seq_printf(m, "\n\tServer interfaces: %zu\n",
ses->iface_count);
for (j = 0; j < ses->iface_count; j++) {
+ struct cifs_server_iface *iface;
+
+ iface = &ses->iface_list[j];
seq_printf(m, "\t%d)", j);
- cifs_dump_iface(m, &ses->iface_list[j]);
+ cifs_dump_iface(m, iface);
+ if (is_ses_using_iface(ses, iface))
+ seq_puts(m, "\t\t[CONNECTED]\n");
}
spin_unlock(&ses->iface_lock);
}
--
2.16.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] cifs: dump channel info in DebugData
2019-11-25 12:16 ` [PATCH v2] " Aurelien Aptel
@ 2019-11-25 16:24 ` kbuild test robot
0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-11-25 16:24 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3902 bytes --]
Hi Aurelien,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.4]
[cannot apply to cifs/for-next next-20191125]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Aurelien-Aptel/cifs-dump-channel-info-in-DebugData/20191125-222805
base: 219d54332a09e8d8741c1e1982f5eae56099de85
config: microblaze-mmu_defconfig (attached as .config)
compiler: microblaze-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
>> fs/cifs/cifs_debug.c:125:53: warning: 'struct cifs_chan' declared inside parameter list will not be visible outside of this definition or declaration
cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
^~~~~~~~~
fs/cifs/cifs_debug.c: In function 'cifs_dump_channel':
>> fs/cifs/cifs_debug.c:127:39: error: dereferencing pointer to incomplete type 'struct cifs_chan'
struct TCP_Server_Info *server = chan->server;
^~
fs/cifs/cifs_debug.c: In function 'cifs_debug_data_proc_show':
>> fs/cifs/cifs_debug.c:402:13: error: 'struct cifs_ses' has no member named 'chan_count'; did you mean 'ses_count'?
if (ses->chan_count > 1) {
^~~~~~~~~~
ses_count
fs/cifs/cifs_debug.c:404:14: error: 'struct cifs_ses' has no member named 'chan_count'; did you mean 'ses_count'?
ses->chan_count-1);
^~~~~~~~~~
ses_count
fs/cifs/cifs_debug.c:405:26: error: 'struct cifs_ses' has no member named 'chan_count'; did you mean 'ses_count'?
for (j = 1; j < ses->chan_count; j++)
^~~~~~~~~~
ses_count
>> fs/cifs/cifs_debug.c:406:34: error: 'struct cifs_ses' has no member named 'chans'
cifs_dump_channel(m, j, &ses->chans[j]);
^~
>> fs/cifs/cifs_debug.c:452:9: error: implicit declaration of function 'is_ses_using_iface' [-Werror=implicit-function-declaration]
if (is_ses_using_iface(ses, iface))
^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +127 fs/cifs/cifs_debug.c
123
124 static void
> 125 cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
126 {
> 127 struct TCP_Server_Info *server = chan->server;
128
129 seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
130 "TCP status: %d Instance: %d Local Users To Server: %d "
131 "SecMode: 0x%x Req On Wire: %d"
132 #ifdef CONFIG_CIFS_STATS2
133 " In Send: %d In MaxReq Wait: %d"
134 #endif
135 "\n",
136 i+1,
137 server->credits,
138 server->dialect,
139 server->tcpStatus,
140 server->reconnect_instance,
141 server->srv_count,
142 server->sec_mode,
143 in_flight(server)
144 #ifdef CONFIG_CIFS_STATS2
145 ,atomic_read(&server->in_send),
146 atomic_read(&server->num_waiters)
147 #endif
148 );
149 }
150
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 13962 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-11-25 16:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 16:15 [PATCH 1/2] cifs: dump channel info in DebugData Aurelien Aptel
2019-11-20 16:15 ` [PATCH 2/2] cifs: try harder to open new channels Aurelien Aptel
2019-11-21 21:54 ` [PATCH 1/2] cifs: dump channel info in DebugData Steve French
2019-11-25 12:16 ` [PATCH v2] " Aurelien Aptel
2019-11-25 16:24 ` kbuild test robot
2019-11-21 23:44 ` [PATCH 1/2] " Steve French
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.