SUNRPC: Merge svc_do_enqueue_xprt() into svc_enqueue_xprt()
[ Upstream commit c0219c499799c1e92bd570c15a47e6257a27bb15 ] Neil says: "These functions were separated in commit 0971374e2818 ("SUNRPC: Reduce contention in svc_xprt_enqueue()") so that the XPT_BUSY check happened before taking any spinlocks. We have since moved or removed the spinlocks so the extra test is fairly pointless." I've made this a separate patch in case the XPT_BUSY change has unexpected consequences and needs to be reverted. Suggested-by: Neil Brown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
de06412bad
commit
4a3e4e558d
1 changed files with 10 additions and 16 deletions
|
@ -31,7 +31,6 @@ static int svc_deferred_recv(struct svc_rqst *rqstp);
|
|||
static struct cache_deferred_req *svc_defer(struct cache_req *req);
|
||||
static void svc_age_temp_xprts(struct timer_list *t);
|
||||
static void svc_delete_xprt(struct svc_xprt *xprt);
|
||||
static void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
||||
|
||||
/* apparently the "standard" is that clients close
|
||||
* idle connections after 5 minutes, servers after
|
||||
|
@ -254,12 +253,12 @@ void svc_xprt_received(struct svc_xprt *xprt)
|
|||
trace_svc_xprt_received(xprt);
|
||||
|
||||
/* As soon as we clear busy, the xprt could be closed and
|
||||
* 'put', so we need a reference to call svc_xprt_do_enqueue with:
|
||||
* 'put', so we need a reference to call svc_xprt_enqueue with:
|
||||
*/
|
||||
svc_xprt_get(xprt);
|
||||
smp_mb__before_atomic();
|
||||
clear_bit(XPT_BUSY, &xprt->xpt_flags);
|
||||
svc_xprt_do_enqueue(xprt);
|
||||
svc_xprt_enqueue(xprt);
|
||||
svc_xprt_put(xprt);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(svc_xprt_received);
|
||||
|
@ -399,6 +398,8 @@ static bool svc_xprt_ready(struct svc_xprt *xprt)
|
|||
smp_rmb();
|
||||
xpt_flags = READ_ONCE(xprt->xpt_flags);
|
||||
|
||||
if (xpt_flags & BIT(XPT_BUSY))
|
||||
return false;
|
||||
if (xpt_flags & (BIT(XPT_CONN) | BIT(XPT_CLOSE)))
|
||||
return true;
|
||||
if (xpt_flags & (BIT(XPT_DATA) | BIT(XPT_DEFERRED))) {
|
||||
|
@ -411,7 +412,12 @@ static bool svc_xprt_ready(struct svc_xprt *xprt)
|
|||
return false;
|
||||
}
|
||||
|
||||
static void svc_xprt_do_enqueue(struct svc_xprt *xprt)
|
||||
/**
|
||||
* svc_xprt_enqueue - Queue a transport on an idle nfsd thread
|
||||
* @xprt: transport with data pending
|
||||
*
|
||||
*/
|
||||
void svc_xprt_enqueue(struct svc_xprt *xprt)
|
||||
{
|
||||
struct svc_pool *pool;
|
||||
struct svc_rqst *rqstp = NULL;
|
||||
|
@ -455,18 +461,6 @@ out_unlock:
|
|||
put_cpu();
|
||||
trace_svc_xprt_do_enqueue(xprt, rqstp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Queue up a transport with data pending. If there are idle nfsd
|
||||
* processes, wake 'em up.
|
||||
*
|
||||
*/
|
||||
void svc_xprt_enqueue(struct svc_xprt *xprt)
|
||||
{
|
||||
if (test_bit(XPT_BUSY, &xprt->xpt_flags))
|
||||
return;
|
||||
svc_xprt_do_enqueue(xprt);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(svc_xprt_enqueue);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue