[DLM] Make dlm_sendd cond_resched more
authorPatrick Caulfield <pcaulfie@redhat.com>
Fri, 14 Sep 2007 07:49:21 +0000 (08:49 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Oct 2007 07:56:19 +0000 (08:56 +0100)
Under high recovery loads dlm_sendd can monopolise the CPU and cause soft lockups.

This one extra and one moved cond_resched() make it yield a little more during
such times keeping work moving.

Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lowcomms.c

index 62a8a6c..58bf3f5 100644 (file)
@@ -1264,14 +1264,15 @@ static void send_to_sock(struct connection *con)
                if (len) {
                        ret = sendpage(con->sock, e->page, offset, len,
                                       msg_flags);
-                       if (ret == -EAGAIN || ret == 0)
+                       if (ret == -EAGAIN || ret == 0) {
+                               cond_resched();
                                goto out;
+                       }
                        if (ret <= 0)
                                goto send_error;
-               } else {
+               }
                        /* Don't starve people filling buffers */
                        cond_resched();
-               }
 
                spin_lock(&con->writequeue_lock);
                e->offset += ret;