Whamcloud - gitweb
b=23289 revert patch on 21828
authorLiang Zhen <liang@whamcloud.com>
Wed, 15 Dec 2010 15:04:30 +0000 (23:04 +0800)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Fri, 17 Dec 2010 01:22:06 +0000 (04:22 +0300)
this patch reverted change on bug 21828, because svc::srv_n_active_reqs
is dropped by ptlrpc_server_finish_request() now which is used to be
dropped by last calling of ptlrpc_server_drop_request, so recovery
thread has no refcount on svc::srv_n_active_reqs and we should just
remove these refcount changes.
This should also resovled issue of bug 21140, because logic in
ptlrpc_server_request_get() can be totally screwed up by
ptlrpc_server_active_request_inc/dec.

lustre/include/lustre_net.h
lustre/ldlm/ldlm_lib.c
lustre/ptlrpc/service.c

index d6634c7..f74547c 100644 (file)
@@ -1502,8 +1502,6 @@ int liblustre_check_services (void *arg);
 void ptlrpc_daemonize(char *name);
 int ptlrpc_service_health_check(struct ptlrpc_service *);
 void ptlrpc_hpreq_reorder(struct ptlrpc_request *req);
-void ptlrpc_server_active_request_inc(struct ptlrpc_request *req);
-void ptlrpc_server_active_request_dec(struct ptlrpc_request *req);
 void ptlrpc_server_drop_request(struct ptlrpc_request *req);
 
 #ifdef __KERNEL__
index fb20bad..6a8f448 100644 (file)
@@ -1124,10 +1124,6 @@ static void target_request_copy_get(struct ptlrpc_request *req)
         cfs_atomic_inc(&req->rq_refcount);
         /** let export know it has replays to be handled */
         cfs_atomic_inc(&req->rq_export->exp_replay_count);
-        /* release service thread while request is queued 
-         * we are moving the request from active processing
-         * to waiting on the replay queue */
-        ptlrpc_server_active_request_dec(req);
 }
 
 static void target_request_copy_put(struct ptlrpc_request *req)
@@ -1137,8 +1133,6 @@ static void target_request_copy_put(struct ptlrpc_request *req)
 
         cfs_atomic_dec(&req->rq_export->exp_replay_count);
         class_export_rpc_put(req->rq_export);
-        /* ptlrpc_server_drop_request() assumes the request is active */
-        ptlrpc_server_active_request_inc(req);
         ptlrpc_server_drop_request(req);
 }
 
index 2768325..3dd00ba 100644 (file)
@@ -643,32 +643,6 @@ static void ptlrpc_server_free_request(struct ptlrpc_request *req)
 }
 
 /**
- * increment the number of active requests consuming service threads.
- */
-void ptlrpc_server_active_request_inc(struct ptlrpc_request *req)
-{
-        struct ptlrpc_request_buffer_desc *rqbd = req->rq_rqbd;
-        struct ptlrpc_service *svc = rqbd->rqbd_service;
-
-        cfs_spin_lock(&svc->srv_rq_lock);
-        svc->srv_n_active_reqs++;
-        cfs_spin_unlock(&svc->srv_rq_lock);
-}
-
-/**
- * decrement the number of active requests consuming service threads.
- */
-void ptlrpc_server_active_request_dec(struct ptlrpc_request *req)
-{
-        struct ptlrpc_request_buffer_desc *rqbd = req->rq_rqbd;
-        struct ptlrpc_service *svc = rqbd->rqbd_service;
-
-        cfs_spin_lock(&svc->srv_rq_lock);
-        svc->srv_n_active_reqs--;
-        cfs_spin_unlock(&svc->srv_rq_lock);
-}
-
-/**
  * drop a reference count of the request. if it reaches 0, we either
  * put it into history list, or free it immediately.
  */