Whamcloud - gitweb
LU-5548 ptlrpc: avoid list scan in ptlrpcd_check 13/11513/3
authorLiang Zhen <liang.zhen@intel.com>
Tue, 19 Aug 2014 02:55:04 +0000 (10:55 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 30 Aug 2014 01:27:20 +0000 (01:27 +0000)
commit432410cecf53f4d07ab7f67d1ad99acce895bdbb
tree68fcd94f298230e518fcefedd5d30dc4ff5fba11
parent7b8487f170af5ddb80ffe7a3b6e2655550006ff8
LU-5548 ptlrpc: avoid list scan in ptlrpcd_check

ptlrpcd_check() always scan all requests on ptlrpc_request_set
and try to finish completed requests, this is low efficiency.
Even worse, l_wait_event() always checks condition for twice
before sleeping and one more time after waking up, which means
it will call ptlrpcd_check() for three times in each loop.

This patch will move completed requests at the head of list
in ptlrpc_check_set(), with this change ptlrpcd_check doesn't
need to scan all requests anymore.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: I84ef477717b53be9e508a596594f176c9de476bb
Reviewed-on: http://review.whamcloud.com/11513
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/client.c
lustre/ptlrpc/ptlrpcd.c