Whamcloud - gitweb
LU-5548 ptlrpc: avoid list scan in ptlrpcd_check 65/12265/3
authorLiang Zhen <liang.zhen@intel.com>
Tue, 19 Aug 2014 02:55:04 +0000 (10:55 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 1 Dec 2014 04:21:03 +0000 (04:21 +0000)
commitf3c91d57afb631d9d008710b4d144734bfe97a4f
treeb48fdc9ac25108411d93aebd11bd089eeb4a0e29
parent078dee1448c2995257923dc712943eab2c78e48e
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>
Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I770016d4a2bcd51603b390b41427eb64ff52f71c
Reviewed-on: http://review.whamcloud.com/12265
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/client.c
lustre/ptlrpc/ptlrpcd.c