From 0ca7eb23309070f85f06f6e192395ed305c59108 Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Wed, 15 Dec 2010 23:04:30 +0800 Subject: [PATCH] b=23289 revert patch on 21828 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 | 2 -- lustre/ldlm/ldlm_lib.c | 6 ------ lustre/ptlrpc/service.c | 26 -------------------------- 3 files changed, 34 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index d6634c7..f74547c 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -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__ diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index fb20bad..6a8f448 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -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); } diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 2768325..3dd00ba 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -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. */ -- 1.8.3.1