mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
SUNRPC: Remove the .svo_enqueue_xprt method
We have never been able to track down and address the underlying
cause of the performance issues with workqueue-based service
support. svo_enqueue_xprt is called multiple times per RPC, so
it adds instruction path length, but always ends up at the same
function: svc_xprt_do_enqueue(). We do not anticipate needing
this flexibility for dynamic nfsd thread management support.
As a micro-optimization, remove .svo_enqueue_xprt because
Spectre/Meltdown makes virtual function calls more costly.
This change essentially reverts commit b9e13cdfac
("nfsd/sunrpc:
turn enqueueing a svc_xprt into a svc_serv operation").
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
70a60cbfb6
commit
a9ff2e99e9
6 changed files with 5 additions and 13 deletions
|
@ -353,7 +353,6 @@ static struct notifier_block lockd_inet6addr_notifier = {
|
||||||
static const struct svc_serv_ops lockd_sv_ops = {
|
static const struct svc_serv_ops lockd_sv_ops = {
|
||||||
.svo_shutdown = svc_rpcb_cleanup,
|
.svo_shutdown = svc_rpcb_cleanup,
|
||||||
.svo_function = lockd,
|
.svo_function = lockd,
|
||||||
.svo_enqueue_xprt = svc_xprt_do_enqueue,
|
|
||||||
.svo_module = THIS_MODULE,
|
.svo_module = THIS_MODULE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -234,13 +234,11 @@ err_bind:
|
||||||
|
|
||||||
static const struct svc_serv_ops nfs40_cb_sv_ops = {
|
static const struct svc_serv_ops nfs40_cb_sv_ops = {
|
||||||
.svo_function = nfs4_callback_svc,
|
.svo_function = nfs4_callback_svc,
|
||||||
.svo_enqueue_xprt = svc_xprt_do_enqueue,
|
|
||||||
.svo_module = THIS_MODULE,
|
.svo_module = THIS_MODULE,
|
||||||
};
|
};
|
||||||
#if defined(CONFIG_NFS_V4_1)
|
#if defined(CONFIG_NFS_V4_1)
|
||||||
static const struct svc_serv_ops nfs41_cb_sv_ops = {
|
static const struct svc_serv_ops nfs41_cb_sv_ops = {
|
||||||
.svo_function = nfs41_callback_svc,
|
.svo_function = nfs41_callback_svc,
|
||||||
.svo_enqueue_xprt = svc_xprt_do_enqueue,
|
|
||||||
.svo_module = THIS_MODULE,
|
.svo_module = THIS_MODULE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -615,7 +615,6 @@ static int nfsd_get_default_max_blksize(void)
|
||||||
static const struct svc_serv_ops nfsd_thread_sv_ops = {
|
static const struct svc_serv_ops nfsd_thread_sv_ops = {
|
||||||
.svo_shutdown = nfsd_last_thread,
|
.svo_shutdown = nfsd_last_thread,
|
||||||
.svo_function = nfsd,
|
.svo_function = nfsd,
|
||||||
.svo_enqueue_xprt = svc_xprt_do_enqueue,
|
|
||||||
.svo_module = THIS_MODULE,
|
.svo_module = THIS_MODULE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,6 @@ struct svc_serv_ops {
|
||||||
/* function for service threads to run */
|
/* function for service threads to run */
|
||||||
int (*svo_function)(void *);
|
int (*svo_function)(void *);
|
||||||
|
|
||||||
/* queue up a transport for servicing */
|
|
||||||
void (*svo_enqueue_xprt)(struct svc_xprt *);
|
|
||||||
|
|
||||||
/* optional module to count when adding threads.
|
/* optional module to count when adding threads.
|
||||||
* Thread function must call module_put_and_kthread_exit() to exit.
|
* Thread function must call module_put_and_kthread_exit() to exit.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -131,7 +131,6 @@ int svc_create_xprt(struct svc_serv *, const char *, struct net *,
|
||||||
const int, const unsigned short, int,
|
const int, const unsigned short, int,
|
||||||
const struct cred *);
|
const struct cred *);
|
||||||
void svc_xprt_received(struct svc_xprt *xprt);
|
void svc_xprt_received(struct svc_xprt *xprt);
|
||||||
void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
|
||||||
void svc_xprt_enqueue(struct svc_xprt *xprt);
|
void svc_xprt_enqueue(struct svc_xprt *xprt);
|
||||||
void svc_xprt_put(struct svc_xprt *xprt);
|
void svc_xprt_put(struct svc_xprt *xprt);
|
||||||
void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
|
void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
|
||||||
|
|
|
@ -32,6 +32,7 @@ static int svc_deferred_recv(struct svc_rqst *rqstp);
|
||||||
static struct cache_deferred_req *svc_defer(struct cache_req *req);
|
static struct cache_deferred_req *svc_defer(struct cache_req *req);
|
||||||
static void svc_age_temp_xprts(struct timer_list *t);
|
static void svc_age_temp_xprts(struct timer_list *t);
|
||||||
static void svc_delete_xprt(struct svc_xprt *xprt);
|
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
|
/* apparently the "standard" is that clients close
|
||||||
* idle connections after 5 minutes, servers after
|
* idle connections after 5 minutes, servers after
|
||||||
|
@ -266,12 +267,12 @@ void svc_xprt_received(struct svc_xprt *xprt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* As soon as we clear busy, the xprt could be closed and
|
/* As soon as we clear busy, the xprt could be closed and
|
||||||
* 'put', so we need a reference to call svc_enqueue_xprt with:
|
* 'put', so we need a reference to call svc_xprt_do_enqueue with:
|
||||||
*/
|
*/
|
||||||
svc_xprt_get(xprt);
|
svc_xprt_get(xprt);
|
||||||
smp_mb__before_atomic();
|
smp_mb__before_atomic();
|
||||||
clear_bit(XPT_BUSY, &xprt->xpt_flags);
|
clear_bit(XPT_BUSY, &xprt->xpt_flags);
|
||||||
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
svc_xprt_do_enqueue(xprt);
|
||||||
svc_xprt_put(xprt);
|
svc_xprt_put(xprt);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(svc_xprt_received);
|
EXPORT_SYMBOL_GPL(svc_xprt_received);
|
||||||
|
@ -423,7 +424,7 @@ static bool svc_xprt_ready(struct svc_xprt *xprt)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void svc_xprt_do_enqueue(struct svc_xprt *xprt)
|
static void svc_xprt_do_enqueue(struct svc_xprt *xprt)
|
||||||
{
|
{
|
||||||
struct svc_pool *pool;
|
struct svc_pool *pool;
|
||||||
struct svc_rqst *rqstp = NULL;
|
struct svc_rqst *rqstp = NULL;
|
||||||
|
@ -467,7 +468,6 @@ out_unlock:
|
||||||
put_cpu();
|
put_cpu();
|
||||||
trace_svc_xprt_enqueue(xprt, rqstp);
|
trace_svc_xprt_enqueue(xprt, rqstp);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Queue up a transport with data pending. If there are idle nfsd
|
* Queue up a transport with data pending. If there are idle nfsd
|
||||||
|
@ -478,7 +478,7 @@ void svc_xprt_enqueue(struct svc_xprt *xprt)
|
||||||
{
|
{
|
||||||
if (test_bit(XPT_BUSY, &xprt->xpt_flags))
|
if (test_bit(XPT_BUSY, &xprt->xpt_flags))
|
||||||
return;
|
return;
|
||||||
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
svc_xprt_do_enqueue(xprt);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(svc_xprt_enqueue);
|
EXPORT_SYMBOL_GPL(svc_xprt_enqueue);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue