summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-01-22 23:47:29 +0000
committermav <mav@FreeBSD.org>2014-01-22 23:47:29 +0000
commit76d8788652a3da858c696457a1903a205f3684e7 (patch)
treeb813eee2994654aa8371b1da8f4f503f4dd35fb5 /sys/nfs
parent01e3debc7e24dfa40ae5ba8fdd9bf0142cfe4593 (diff)
downloadFreeBSD-src-76d8788652a3da858c696457a1903a205f3684e7.zip
FreeBSD-src-76d8788652a3da858c696457a1903a205f3684e7.tar.gz
MFC r259659, r259662:
Remove several linear list traversals per request from RPC server code. Do not insert active ports into pool->sp_active list if they are success- fully assigned to some thread. This makes that list include only ports that really require attention, and so traversal can be reduced to simple taking the first one. Remove idle thread from pool->sp_idlethreads list when assigning some work (port of requests) to it. That again makes possible to replace list traversals with simple taking the first element.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_fha.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/nfs/nfs_fha.c b/sys/nfs/nfs_fha.c
index dd9ee27..2290804 100644
--- a/sys/nfs/nfs_fha.c
+++ b/sys/nfs/nfs_fha.c
@@ -289,19 +289,6 @@ fha_hash_entry_add_op(struct fha_hash_entry *fhe, int locktype, int count)
fhe->num_rw += count;
}
-static SVCTHREAD *
-get_idle_thread(SVCPOOL *pool)
-{
- SVCTHREAD *st;
-
- LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) {
- if (st->st_xprt == NULL && STAILQ_EMPTY(&st->st_reqs))
- return (st);
- }
- return (NULL);
-}
-
-
/*
* Get the service thread currently associated with the fhe that is
* appropriate to handle this operation.
@@ -386,7 +373,7 @@ fha_hash_entry_choose_thread(struct fha_params *softc,
ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO,
"fha: %p(%d)t", thread, thread->st_reqcount);
#endif
- } else if ((thread = get_idle_thread(pool))) {
+ } else if ((thread = LIST_FIRST(&pool->sp_idlethreads))) {
#if 0
ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO,
"fha: %p(%d)i", thread, thread->st_reqcount);
@@ -418,7 +405,6 @@ SVCTHREAD *
fha_assign(SVCTHREAD *this_thread, struct svc_req *req,
struct fha_params *softc)
{
- SVCPOOL *pool;
SVCTHREAD *thread;
struct fha_info i;
struct fha_hash_entry *fhe;
@@ -439,7 +425,6 @@ fha_assign(SVCTHREAD *this_thread, struct svc_req *req,
if (req->rq_vers != 2 && req->rq_vers != 3)
return (this_thread);
- pool = req->rq_xprt->xp_pool;
fha_extract_info(req, &i, cb);
/*
OpenPOWER on IntegriCloud