aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-09-23 21:28:32 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-25 08:25:47 -0400
commit1aff52562939485e503936e17934be077ffaea53 (patch)
tree16dba0b5ce0005389ea045e29f69c6b65d133e32 /net
parent353db7966288a2f18da22438aeec2b4862c0b241 (diff)
NFS/SUNRPC: Remove other deadlock-avoidance mechanisms in nfs_release_page()
Now that nfs_release_page() doesn't block indefinitely, other deadlock avoidance mechanisms aren't needed. - it doesn't hurt for kswapd to block occasionally. If it doesn't want to block it would clear __GFP_WAIT. The current_is_kswapd() was only added to avoid deadlocks and we have a new approach for that. - memory allocation in the SUNRPC layer can very rarely try to ->releasepage() a page it is trying to handle. The deadlock is removed as nfs_release_page() doesn't block indefinitely. So we don't need to set PF_FSTRANS for sunrpc network operations any more. Signed-off-by: NeilBrown <neilb@suse.de> Acked-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/sched.c2
-rw-r--r--net/sunrpc/xprtrdma/transport.c2
-rw-r--r--net/sunrpc/xprtsock.c10
3 files changed, 0 insertions, 14 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 9358c79fd589..fe3441abdbe5 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -821,9 +821,7 @@ void rpc_execute(struct rpc_task *task)
821 821
822static void rpc_async_schedule(struct work_struct *work) 822static void rpc_async_schedule(struct work_struct *work)
823{ 823{
824 current->flags |= PF_FSTRANS;
825 __rpc_execute(container_of(work, struct rpc_task, u.tk_work)); 824 __rpc_execute(container_of(work, struct rpc_task, u.tk_work));
826 current->flags &= ~PF_FSTRANS;
827} 825}
828 826
829/** 827/**
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 2faac4940563..6a4615dd0261 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -205,7 +205,6 @@ xprt_rdma_connect_worker(struct work_struct *work)
205 struct rpc_xprt *xprt = &r_xprt->xprt; 205 struct rpc_xprt *xprt = &r_xprt->xprt;
206 int rc = 0; 206 int rc = 0;
207 207
208 current->flags |= PF_FSTRANS;
209 xprt_clear_connected(xprt); 208 xprt_clear_connected(xprt);
210 209
211 dprintk("RPC: %s: %sconnect\n", __func__, 210 dprintk("RPC: %s: %sconnect\n", __func__,
@@ -216,7 +215,6 @@ xprt_rdma_connect_worker(struct work_struct *work)
216 215
217 dprintk("RPC: %s: exit\n", __func__); 216 dprintk("RPC: %s: exit\n", __func__);
218 xprt_clear_connecting(xprt); 217 xprt_clear_connecting(xprt);
219 current->flags &= ~PF_FSTRANS;
220} 218}
221 219
222/* 220/*
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 02603ec2460a..3b305ab17afe 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1954,8 +1954,6 @@ static int xs_local_setup_socket(struct sock_xprt *transport)
1954 struct socket *sock; 1954 struct socket *sock;
1955 int status = -EIO; 1955 int status = -EIO;
1956 1956
1957 current->flags |= PF_FSTRANS;
1958
1959 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); 1957 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
1960 status = __sock_create(xprt->xprt_net, AF_LOCAL, 1958 status = __sock_create(xprt->xprt_net, AF_LOCAL,
1961 SOCK_STREAM, 0, &sock, 1); 1959 SOCK_STREAM, 0, &sock, 1);
@@ -1995,7 +1993,6 @@ static int xs_local_setup_socket(struct sock_xprt *transport)
1995out: 1993out:
1996 xprt_clear_connecting(xprt); 1994 xprt_clear_connecting(xprt);
1997 xprt_wake_pending_tasks(xprt, status); 1995 xprt_wake_pending_tasks(xprt, status);
1998 current->flags &= ~PF_FSTRANS;
1999 return status; 1996 return status;
2000} 1997}
2001 1998
@@ -2098,8 +2095,6 @@ static void xs_udp_setup_socket(struct work_struct *work)
2098 struct socket *sock = transport->sock; 2095 struct socket *sock = transport->sock;
2099 int status = -EIO; 2096 int status = -EIO;
2100 2097
2101 current->flags |= PF_FSTRANS;
2102
2103 /* Start by resetting any existing state */ 2098 /* Start by resetting any existing state */
2104 xs_reset_transport(transport); 2099 xs_reset_transport(transport);
2105 sock = xs_create_sock(xprt, transport, 2100 sock = xs_create_sock(xprt, transport,
@@ -2119,7 +2114,6 @@ static void xs_udp_setup_socket(struct work_struct *work)
2119out: 2114out:
2120 xprt_clear_connecting(xprt); 2115 xprt_clear_connecting(xprt);
2121 xprt_wake_pending_tasks(xprt, status); 2116 xprt_wake_pending_tasks(xprt, status);
2122 current->flags &= ~PF_FSTRANS;
2123} 2117}
2124 2118
2125/* 2119/*
@@ -2256,8 +2250,6 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2256 struct rpc_xprt *xprt = &transport->xprt; 2250 struct rpc_xprt *xprt = &transport->xprt;
2257 int status = -EIO; 2251 int status = -EIO;
2258 2252
2259 current->flags |= PF_FSTRANS;
2260
2261 if (!sock) { 2253 if (!sock) {
2262 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); 2254 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
2263 sock = xs_create_sock(xprt, transport, 2255 sock = xs_create_sock(xprt, transport,
@@ -2305,7 +2297,6 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2305 case -EINPROGRESS: 2297 case -EINPROGRESS:
2306 case -EALREADY: 2298 case -EALREADY:
2307 xprt_clear_connecting(xprt); 2299 xprt_clear_connecting(xprt);
2308 current->flags &= ~PF_FSTRANS;
2309 return; 2300 return;
2310 case -EINVAL: 2301 case -EINVAL:
2311 /* Happens, for instance, if the user specified a link 2302 /* Happens, for instance, if the user specified a link
@@ -2323,7 +2314,6 @@ out_eagain:
2323out: 2314out:
2324 xprt_clear_connecting(xprt); 2315 xprt_clear_connecting(xprt);
2325 xprt_wake_pending_tasks(xprt, status); 2316 xprt_wake_pending_tasks(xprt, status);
2326 current->flags &= ~PF_FSTRANS;
2327} 2317}
2328 2318
2329/** 2319/**