mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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>
This commit is contained in:
parent
3c87ef6efb
commit
8e2281330f
3 changed files with 30 additions and 17 deletions
|
@ -2495,7 +2495,7 @@ retry:
|
|||
goto retry;
|
||||
}
|
||||
|
||||
ret = xs_swapper(xprt, 1);
|
||||
ret = xs_swapper_enable(xprt);
|
||||
xprt_put(xprt);
|
||||
}
|
||||
return ret;
|
||||
|
@ -2522,7 +2522,7 @@ retry:
|
|||
goto retry;
|
||||
}
|
||||
|
||||
xs_swapper(xprt, 0);
|
||||
xs_swapper_disable(xprt);
|
||||
xprt_put(xprt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue