sunrpc: clean up "swapper" xprt handling
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 1 replyIn review
- v25 patches 4 repliesSuperseded
- v14 patches 9 repliesSuperseded
Changes in v3 from the cover letter
- make "enable" operations return -EINVAL when CONFIG_NFS_SWAP is disabled.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | sunrpc: keep a count of swapfiles associated with the rpc_clntfs/ include/ include/ +2 more | +78 | 0 replies | |
| 2/5 | sunrpc: make xprt->swapper an atomic_tinclude/ net/ net/ | +30 | 0 replies | |
| 3/5 | sunrpc: if we're closing down a socket, clear memalloc on it firstnet/ | +3 | 0 replies | |
| 4/5 | sunrpc: lock xprt before trying to set memalloc on the socketsnet/ | +27 | 0 replies | |
| 5/5 | sunrpc: turn swapper_enable/disable functions into rpc_xprt_opsinclude/ net/ net/ +1 more | +55 | 1 reply |
Reviews trailers per patch
3 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Mel Gorman | Chuck Lever |
|---|---|---|
| 1/5 | A-b | |
| 2/5 | ||
| 3/5 | A-b | |
| 4/5 | ||
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/5] sunrpc: clean up "swapper" xprt handling
v3:
- make "enable" operations return -EINVAL when CONFIG_NFS_SWAP is disabled.
v2:
- don't take xprt lock unless we need to manipulate the memalloc flag
- add new xprt operations for swap enable/disable
This series is a (small) overhaul of the swap-over-NFS code. The main impetus is to fix the problem reported by Jerome Marchand. We currently hold the rcu_read_lock when calling xs_swapper and that's just plain wrong. The first patch in this series should fix that problem, and also clean up a bit of a layering violation.
The other focus of this set is to change how the swapper refcounting works. Right now, it's only tracked in the rpc_xprt, and there seem to be some gaps in its coverage -- places where we should taking or dropping references but aren't. This changes it so that the clnt tracks the number of swapfiles that it has, and the xprt tracks the number of "swappable" clients.
It also ensures that we only call sk_set_memalloc once per socket. I believe that's the correct thing to do as the main reason for the memalloc_socks counter is to track whether we have _any_ memalloc-enabled sockets.
There is still some work to be done here as I think there remains some potential for races between swapon/swapoff, and reconnect or migration events. That will take some careful thought that I haven't the time to spend on at the moment. I don't think this set will make those races any worse though.
Jeff Layton (5):
sunrpc: keep a count of swapfiles associated with the rpc_clnt
sunrpc: make xprt->swapper an atomic_t
sunrpc: if we're closing down a socket, clear memalloc on it first
sunrpc: lock xprt before trying to set memalloc on the sockets
sunrpc: turn swapper_enable/disable functions into rpc_xprt_ops
fs/nfs/file.c | 15 +------ include/linux/sunrpc/clnt.h | 1 + include/linux/sunrpc/sched.h | 16 ++++++++ include/linux/sunrpc/xprt.h | 17 +++++++- net/sunrpc/clnt.c | 67 +++++++++++++++++++++++++++----- net/sunrpc/xprtrdma/transport.c | 15 ++++++- net/sunrpc/xprtsock.c | 86 +++++++++++++++++++++++++++++++++-------- 7 files changed, 175 insertions(+), 42 deletions(-)
Signature · 7 lines
2.4.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>