linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Jeffery <djeffery@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
Date: Tue, 5 Aug 2014 11:19:42 -0400 (EDT)	[thread overview]
Message-ID: <1630665170.14504134.1407251982055.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1195286747.14503775.1407251856163.JavaMail.zimbra@redhat.com>


If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait,
it will busy-wait or soft lockup in its while loop.
nfs_wait_bit_killable won't sleep, and the loop won't exit on
the error return.  

Stop the busy-wait by breaking out of the loop when
nfs_wait_bit_killable returns an error.

Signed-off-by: David Jeffery <djeffery@redhat.com>
---
I'm not completely confident this is the right solution. I
would like feedback if the intention was to break out of
this loop on error, or if we do need to wait here until
io_count hits zero and use something other than
nfs_wait_bit_killable to wait in case of SIGKILL.

 pagelist.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 17fab89..f29a690 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
 		if (atomic_read(&c->io_count) == 0)
 			break;
 		ret = nfs_wait_bit_killable(&c->flags);
-	} while (atomic_read(&c->io_count) != 0);
+	} while (atomic_read(&c->io_count) != 0 && !ret);
 	finish_wait(wq, &q.wait);
 	return ret;
 }

       reply	other threads:[~2014-08-05 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1195286747.14503775.1407251856163.JavaMail.zimbra@redhat.com>
2014-08-05 15:19 ` David Jeffery [this message]
2014-08-21  0:29   ` [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1630665170.14504134.1407251982055.JavaMail.zimbra@redhat.com \
    --to=djeffery@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).