diff options
author | Alexander Motin <mav@FreeBSD.org> | 2013-12-20 17:39:07 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2013-12-20 17:39:07 +0000 |
commit | ba981145d6dcc5a8aa74ab993084e2dc16d94224 (patch) | |
tree | 7a14db28a6dfb2aead074a8a7ba69d16b538926c /sys/nfs | |
parent | c63e7b9304cba5d56eea47ed81debbb1297aba6d (diff) | |
download | src-ba981145d6dcc5a8aa74ab993084e2dc16d94224.tar.gz src-ba981145d6dcc5a8aa74ab993084e2dc16d94224.zip |
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.
Notes
Notes:
svn path=/head/; revision=259659
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_fha.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/nfs/nfs_fha.c b/sys/nfs/nfs_fha.c index dd9ee276889b..229080471171 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); /* |