]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sunrpc: make xprt->swapper an atomic_t
authorJeff Layton <jlayton@poochiereds.net>
Tue, 25 Aug 2015 18:27:37 +0000 (12:27 -0600)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 31 Aug 2015 20:45:54 +0000 (14:45 -0600)
commitc35981bd3e3df0fe550e1fafa41cdd0e33cb5f7f
treefed098fd2491be7e7898763a21c6b987ce1befd8
parentb8f876c2d6086ec9af281f2b469b03907a22486e
sunrpc: make xprt->swapper an atomic_t

[ Upstream commit 8e2281330f9930bccf77cf04027ec60b6cc0fb34 ]

Split xs_swapper into enable/disable functions and eliminate the
"enable" flag.

Currently, it's racy if you have multiple swapon/swapoff operations
running in parallel over the same xprt. Also fix it so that we only
set it to a memalloc socket on a 0->1 transition and only clear it
on a 1->0 transition.

Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
include/linux/sunrpc/xprt.h
net/sunrpc/clnt.c
net/sunrpc/xprtsock.c