Whamcloud - gitweb
b=21140 Fix srv_threads_running counting.
authorAlexander.Zarochentsev <Alexander.Zarochentsev@sun.com>
Wed, 12 May 2010 10:29:19 +0000 (14:29 +0400)
committerRobert Read <robert.read@oracle.com>
Wed, 12 May 2010 19:04:15 +0000 (12:04 -0700)
commit96b814bda9b2d923885291849ae0f14f660c90e1
treeddf0649032fd94431f1e8aa55208c00405217113
parent8c7685d1bdff0508c8aba421910b09e70e1c34e8
b=21140 Fix srv_threads_running counting.

It was possible to overload n_active_request processing incoming requests and
break the thread reservation logic. Likely, it was responsible to the long
processing of requests.

The patch makes srv_threads_running to exactly count only running not sleeping
threads. All threads accounting and comparing/reservation of threads are done
under the service spinlock so it produce a reliable result. The thread
reservation logic is based on new srv_threads_running value and cannot be
confused by not active sleeping threads. The thread reservation logic is
concentrated now in one place, where the wakeup condition is checked (now in
ptlrpc_main_check_event), once a thread is woken up, it is counted as running
and does further work w/o additional checks.

i=zhen.liang
i=robert.read
lustre/ptlrpc/service.c