Commit ae68d0de authored by Steve French's avatar Steve French

fix throttle to limit number of requests to 50 on wire to server at one time.

Signed-off-by: Steve French (sfrench@us.ibm.com)
parent 81a50e44
...@@ -203,15 +203,22 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, ...@@ -203,15 +203,22 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
to the same server. We may make this configurable later or to the same server. We may make this configurable later or
use ses->maxReq */ use ses->maxReq */
spin_lock(&GlobalMid_Lock);
while(1) {
if(atomic_read(&ses->server->inFlight) >= CIFS_MAX_REQ) {
spin_unlock(&GlobalMid_Lock);
wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) < CIFS_MAX_REQ);
spin_lock(&GlobalMid_Lock);
} else {
/* can not count locking commands against the total since /* can not count locking commands against the total since
they are allowed to block on server */ they are allowed to block on server */
if(long_op < 3) { if(long_op < 3) {
/* update # of requests on the wire to this server */ /* update # of requests on the wire to this server */
atomic_inc(&ses->server->inFlight); atomic_inc(&ses->server->inFlight);
} }
spin_unlock(&GlobalMid_Lock);
if(atomic_read(&ses->server->inFlight) > CIFS_MAX_REQ) { break;
wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) <= CIFS_MAX_REQ); }
} }
/* make sure that we sign in the same order that we send on this socket /* make sure that we sign in the same order that we send on this socket
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment