]> git.baikalelectronics.ru Git - kernel.git/commit
sunrpc: make xprt->swapper an atomic_t
authorJeff Layton <jlayton@poochiereds.net>
Wed, 3 Jun 2015 20:14:26 +0000 (16:14 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 10 Jun 2015 22:26:18 +0000 (18:26 -0400)
commit0c9f122f7c5603926d68c60709802bf4a3ae362c
tree6047f570e0ec5de10303d29326d6f62f5d0e2065
parent3ad6f32e34afbb47b63115886fc3620129f0915e
sunrpc: make xprt->swapper an atomic_t

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