diff options
author | Steve French <sfrench@us.ibm.com> | 2005-10-10 13:34:22 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-10-10 13:34:22 -0400 |
commit | 68058e757573d4e81550e74c5a03a29a29069ce7 (patch) | |
tree | d8c6c318e2e486ae707a22915983afd512f38b51 /fs/cifs | |
parent | 131afd0b748e382c3a00355d3fa245801f929298 (diff) |
[CIFS] Reduce CIFS tcp congestion timeout (it was too long) and backoff
ever longer amounts (up to 15 seconds). This improves performance
especially when using large wsize.
Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifs_debug.c | 4 | ||||
-rw-r--r-- | fs/cifs/cifsfs.c | 16 | ||||
-rw-r--r-- | fs/cifs/transport.c | 13 |
3 files changed, 22 insertions, 11 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 785239618d89..b7fb064f6548 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -114,7 +114,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
114 | atomic_read(&ses->server->inFlight)); | 114 | atomic_read(&ses->server->inFlight)); |
115 | 115 | ||
116 | #ifdef CONFIG_CIFS_STATS2 | 116 | #ifdef CONFIG_CIFS_STATS2 |
117 | buf += sprintf(buf, "\tIn Send: %d In MaxReq Wait: %d", | 117 | buf += sprintf(buf, " In Send: %d In MaxReq Wait: %d", |
118 | atomic_read(&ses->server->inSend), | 118 | atomic_read(&ses->server->inSend), |
119 | atomic_read(&ses->server->num_waiters)); | 119 | atomic_read(&ses->server->num_waiters)); |
120 | #endif | 120 | #endif |
@@ -267,7 +267,7 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
267 | atomic_read(&tcon->num_oplock_brks)); | 267 | atomic_read(&tcon->num_oplock_brks)); |
268 | buf += item_length; | 268 | buf += item_length; |
269 | length += item_length; | 269 | length += item_length; |
270 | item_length = sprintf(buf, "\nReads: %d Bytes %lld", | 270 | item_length = sprintf(buf, "\nReads: %d Bytes %lld", |
271 | atomic_read(&tcon->num_reads), | 271 | atomic_read(&tcon->num_reads), |
272 | (long long)(tcon->bytes_read)); | 272 | (long long)(tcon->bytes_read)); |
273 | buf += item_length; | 273 | buf += item_length; |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 1f97d39100ee..e3177a031edc 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -405,6 +405,16 @@ static struct quotactl_ops cifs_quotactl_ops = { | |||
405 | }; | 405 | }; |
406 | #endif | 406 | #endif |
407 | 407 | ||
408 | static void cifs_umount_begin(struct super_block * sblock) | ||
409 | { | ||
410 | cERROR(1,("kill all tasks now - umount begin not implemented yet")); | ||
411 | |||
412 | /* BB FIXME - finish BB */ | ||
413 | |||
414 | return; | ||
415 | } | ||
416 | |||
417 | |||
408 | static int cifs_remount(struct super_block *sb, int *flags, char *data) | 418 | static int cifs_remount(struct super_block *sb, int *flags, char *data) |
409 | { | 419 | { |
410 | *flags |= MS_NODIRATIME; | 420 | *flags |= MS_NODIRATIME; |
@@ -422,7 +432,7 @@ struct super_operations cifs_super_ops = { | |||
422 | unless later we add lazy close of inodes or unless the kernel forgets to call | 432 | unless later we add lazy close of inodes or unless the kernel forgets to call |
423 | us with the same number of releases (closes) as opens */ | 433 | us with the same number of releases (closes) as opens */ |
424 | .show_options = cifs_show_options, | 434 | .show_options = cifs_show_options, |
425 | /* .umount_begin = cifs_umount_begin, *//* consider adding in the future */ | 435 | /* .umount_begin = cifs_umount_begin, */ /* BB finish in the future */ |
426 | .remount_fs = cifs_remount, | 436 | .remount_fs = cifs_remount, |
427 | }; | 437 | }; |
428 | 438 | ||
@@ -790,9 +800,7 @@ static int cifs_oplock_thread(void * dummyarg) | |||
790 | do { | 800 | do { |
791 | if(try_to_freeze()) | 801 | if(try_to_freeze()) |
792 | continue; | 802 | continue; |
793 | set_current_state(TASK_INTERRUPTIBLE); | ||
794 | 803 | ||
795 | schedule_timeout(1*HZ); | ||
796 | spin_lock(&GlobalMid_Lock); | 804 | spin_lock(&GlobalMid_Lock); |
797 | if(list_empty(&GlobalOplock_Q)) { | 805 | if(list_empty(&GlobalOplock_Q)) { |
798 | spin_unlock(&GlobalMid_Lock); | 806 | spin_unlock(&GlobalMid_Lock); |
@@ -841,6 +849,8 @@ static int cifs_oplock_thread(void * dummyarg) | |||
841 | } | 849 | } |
842 | } else | 850 | } else |
843 | spin_unlock(&GlobalMid_Lock); | 851 | spin_unlock(&GlobalMid_Lock); |
852 | set_current_state(TASK_INTERRUPTIBLE); | ||
853 | schedule_timeout(1); /* yield in case q were corrupt */ | ||
844 | } | 854 | } |
845 | } while(!signal_pending(current)); | 855 | } while(!signal_pending(current)); |
846 | oplockThread = NULL; | 856 | oplockThread = NULL; |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 893a6fef9853..d9b11690746d 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -157,14 +157,14 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, | |||
157 | /* smaller timeout here than send2 since smaller size */ | 157 | /* smaller timeout here than send2 since smaller size */ |
158 | /* Although it may not be required, this also is smaller | 158 | /* Although it may not be required, this also is smaller |
159 | oplock break time */ | 159 | oplock break time */ |
160 | if(i > 30) { | 160 | if(i > 12) { |
161 | cERROR(1, | 161 | cERROR(1, |
162 | ("sends on sock %p stuck for 15 seconds", | 162 | ("sends on sock %p stuck for 7 seconds", |
163 | ssocket)); | 163 | ssocket)); |
164 | rc = -EAGAIN; | 164 | rc = -EAGAIN; |
165 | break; | 165 | break; |
166 | } | 166 | } |
167 | msleep(500); | 167 | msleep(1 << i); |
168 | continue; | 168 | continue; |
169 | } | 169 | } |
170 | if (rc < 0) | 170 | if (rc < 0) |
@@ -224,14 +224,14 @@ smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec, | |||
224 | n_vec - first_vec, total_len); | 224 | n_vec - first_vec, total_len); |
225 | if ((rc == -ENOSPC) || (rc == -EAGAIN)) { | 225 | if ((rc == -ENOSPC) || (rc == -EAGAIN)) { |
226 | i++; | 226 | i++; |
227 | if(i > 40) { | 227 | if(i >= 14) { |
228 | cERROR(1, | 228 | cERROR(1, |
229 | ("sends on sock %p stuck for 20 seconds", | 229 | ("sends on sock %p stuck for 15 seconds", |
230 | ssocket)); | 230 | ssocket)); |
231 | rc = -EAGAIN; | 231 | rc = -EAGAIN; |
232 | break; | 232 | break; |
233 | } | 233 | } |
234 | msleep(500); | 234 | msleep(1 << i); |
235 | continue; | 235 | continue; |
236 | } | 236 | } |
237 | if (rc < 0) | 237 | if (rc < 0) |
@@ -249,6 +249,7 @@ smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec, | |||
249 | continue; | 249 | continue; |
250 | } | 250 | } |
251 | total_len -= rc; | 251 | total_len -= rc; |
252 | /* the line below resets i */ | ||
252 | for (i = first_vec; i < n_vec; i++) { | 253 | for (i = first_vec; i < n_vec; i++) { |
253 | if (iov[i].iov_len) { | 254 | if (iov[i].iov_len) { |
254 | if (rc > iov[i].iov_len) { | 255 | if (rc > iov[i].iov_len) { |