* [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
[not found] <1195286747.14503775.1407251856163.JavaMail.zimbra@redhat.com>
@ 2014-08-05 15:19 ` David Jeffery
2014-08-21 0:29 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: David Jeffery @ 2014-08-05 15:19 UTC (permalink / raw
To: linux-nfs
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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
2014-08-05 15:19 ` [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait David Jeffery
@ 2014-08-21 0:29 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2014-08-21 0:29 UTC (permalink / raw
To: David Jeffery; +Cc: linux-nfs
On Tue, 2014-08-05 at 11:19 -0400, David Jeffery wrote:
> 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;
> }
Applied.
--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-21 0:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1195286747.14503775.1407251856163.JavaMail.zimbra@redhat.com>
2014-08-05 15:19 ` [PATCH] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait David Jeffery
2014-08-21 0:29 ` Trond Myklebust
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.