linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] sunrpc: make rpc_wait_bit_killable handle freeze events
@ 2011-10-28  6:08 Jeff Layton
  2011-10-28  6:08 ` [PATCH 2/2] nfs: make TASK_KILLABLE sleeps attempt to freeze Jeff Layton
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Layton @ 2011-10-28  6:08 UTC (permalink / raw)
  To: rjw; +Cc: trond.myklebust, linux-pm, linux-nfs, john, linux-kernel

Allow the wait_on_bit_killable sleeps in SUNRPC layer to respect the
freezer. This should allow suspend and hibernate events to occur, even
when there are RPC's pending on the wire.

Tested-by: John Hughes <john@Calva.COM>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 net/sunrpc/sched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index d12ffa5..09bb64e 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -18,6 +18,7 @@
 #include <linux/smp.h>
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
+#include <linux/freezer.h>
 
 #include <linux/sunrpc/clnt.h>
 
@@ -231,7 +232,8 @@ static int rpc_wait_bit_killable(void *word)
 {
 	if (fatal_signal_pending(current))
 		return -ERESTARTSYS;
-	schedule();
+	if (!try_to_freeze())
+		schedule();
 	return 0;
 }
 
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 0/2] nfs/sunrpc: allow freezing of tasks with NFS calls in flight
@ 2011-11-21 17:40 Jeff Layton
  2011-11-21 17:40 ` [PATCH 1/2] sunrpc: make rpc_wait_bit_killable handle freeze events Jeff Layton
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Layton @ 2011-11-21 17:40 UTC (permalink / raw)
  To: rjw; +Cc: linux-nfs, linux-pm, john, tj, trond.myklebust

This patchset is a second (third?) attempt at fixing the issues with
suspending a machine that has an active NFS mount.

The bug reported against Fedora is here:

    https://bugzilla.redhat.com/show_bug.cgi?id=717735

This patchset is a bit different from the original one. Instead of
attempting to make TASK_KILLABLE sleeps wake up when the freezer runs,
this one makes the freezer skip those processes when it runs.

This is the method that Tejun, Rafael, and Oleg have recommended for
now. Long term, it might make more sense to add a new TASK_WAKEFREEZE
flag or something and awake tasks based on that, and have them then
call try_to_freeze() when awoken. For now though this seems to work
as expected.

So far, results with this patchset have been good, but it seems like
it's a bit late for 3.2. I'd like to see this go in early for 3.3,
probably via Rafael's tree.

Jeff Layton (2):
  sunrpc: make rpc_wait_bit_killable handle freeze events
  nfs: make TASK_KILLABLE sleeps attempt to freeze

 fs/nfs/inode.c          |    3 ++-
 fs/nfs/nfs3proc.c       |    3 ++-
 fs/nfs/nfs4proc.c       |    5 +++--
 fs/nfs/proc.c           |    3 ++-
 include/linux/freezer.h |   22 ++++++++++++++++++++++
 net/sunrpc/sched.c      |    3 ++-
 6 files changed, 33 insertions(+), 6 deletions(-)

-- 
1.7.6.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-21 20:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28  6:08 [PATCH 1/2] sunrpc: make rpc_wait_bit_killable handle freeze events Jeff Layton
2011-10-28  6:08 ` [PATCH 2/2] nfs: make TASK_KILLABLE sleeps attempt to freeze Jeff Layton
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21 17:40 [PATCH 0/2] nfs/sunrpc: allow freezing of tasks with NFS calls in flight Jeff Layton
2011-11-21 17:40 ` [PATCH 1/2] sunrpc: make rpc_wait_bit_killable handle freeze events Jeff Layton
2011-11-21 17:56   ` Tejun Heo
2011-11-21 20:36     ` Jeff Layton
2011-11-21 20:41       ` Tejun Heo
2011-11-21 20:42         ` Tejun Heo
2011-11-21 20:46   ` Tejun Heo
2011-11-21 20:57     ` Jeff Layton

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).