From: Dmitry Eremin Date: Tue, 3 Dec 2013 13:58:51 +0000 (+0800) Subject: staging/lustre/pinger: remove never implemented suspend timeouts functionality X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f4420b2400c03beab7481328c63c8a7c30ee3df6;p=linux-beck.git staging/lustre/pinger: remove never implemented suspend timeouts functionality This is part of original Lustre tree commit. It removes never implemented suspend timeouts functionality from pinger.c which was commented out since 2007 and going to be replaced by adaptive timeouts. Also removed all references to this functionality from ldlm_lockd.c, ldlm_request.c and import.c which actually nevers executes or do nothing. Lustre-change: http://review.whamcloud.com/6139 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3204 Signed-off-by: Dmitry Eremin Signed-off-by: Ned Bass Reviewed-by: Oleg Drokin Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/include/lustre_ha.h b/drivers/staging/lustre/lustre/include/lustre_ha.h index 105f6d61eef0..f3ae02b3eef3 100644 --- a/drivers/staging/lustre/lustre/include/lustre_ha.h +++ b/drivers/staging/lustre/lustre/include/lustre_ha.h @@ -58,9 +58,6 @@ void ptlrpc_activate_import(struct obd_import *imp); void ptlrpc_deactivate_import(struct obd_import *imp); void ptlrpc_invalidate_import(struct obd_import *imp); void ptlrpc_fail_import(struct obd_import *imp, __u32 conn_cnt); -int ptlrpc_check_suspend(void); -void ptlrpc_activate_timeouts(struct obd_import *imp); -void ptlrpc_deactivate_timeouts(struct obd_import *imp); /** @} ha */ diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 91f28e363be2..6c5479b2d715 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -3403,10 +3403,8 @@ int ptlrpc_del_timeout_client(struct list_head *obd_list, enum timeout_event event); struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp); int ptlrpc_obd_ping(struct obd_device *obd); -cfs_time_t ptlrpc_suspend_wakeup_time(void); void ping_evictor_start(void); void ping_evictor_stop(void); -int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req); void ptlrpc_pinger_ir_up(void); void ptlrpc_pinger_ir_down(void); /** @} */ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 4974becb3d9b..a8f8c1cace27 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -97,9 +97,6 @@ int ldlm_expired_completion_wait(void *data) if (lock->l_conn_export == NULL) { static cfs_time_t next_dump = 0, last_dump = 0; - if (ptlrpc_check_suspend()) - return 0; - LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", " CFS_DURATION_T"s ago)\n", lock->l_last_activity, diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 283173a2fe23..f465547eb95e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -170,7 +170,6 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) target_len, target_start, libcfs_nid2str(imp->imp_connection->c_peer.nid)); } - ptlrpc_deactivate_timeouts(imp); IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON); spin_unlock(&imp->imp_lock); @@ -383,7 +382,6 @@ void ptlrpc_activate_import(struct obd_import *imp) spin_lock(&imp->imp_lock); imp->imp_invalid = 0; - ptlrpc_activate_timeouts(imp); spin_unlock(&imp->imp_lock); obd_import_event(obd, imp, IMP_EVENT_ACTIVE); } diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 4684b03c4a5f..6dff502ce23e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -141,9 +141,6 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp) return cfs_time_shift(obd_timeout); } -static atomic_t suspend_timeouts = ATOMIC_INIT(0); -static cfs_time_t suspend_wakeup_time = 0; - cfs_duration_t pinger_check_timeout(cfs_time_t time) { struct timeout_item *item; @@ -163,67 +160,6 @@ cfs_duration_t pinger_check_timeout(cfs_time_t time) cfs_time_current()); } -static wait_queue_head_t suspend_timeouts_waitq; - -cfs_time_t ptlrpc_suspend_wakeup_time(void) -{ - return suspend_wakeup_time; -} - -void ptlrpc_deactivate_timeouts(struct obd_import *imp) -{ - /*XXX: disabled for now, will be replaced by adaptive timeouts */ -#if 0 - if (imp->imp_no_timeout) - return; - imp->imp_no_timeout = 1; - atomic_inc(&suspend_timeouts); - CDEBUG(D_HA|D_WARNING, "deactivate timeouts %u\n", - atomic_read(&suspend_timeouts)); -#endif -} - -void ptlrpc_activate_timeouts(struct obd_import *imp) -{ - /*XXX: disabled for now, will be replaced by adaptive timeouts */ -#if 0 - if (!imp->imp_no_timeout) - return; - imp->imp_no_timeout = 0; - LASSERT(atomic_read(&suspend_timeouts) > 0); - if (atomic_dec_and_test(&suspend_timeouts)) { - suspend_wakeup_time = cfs_time_current(); - wake_up(&suspend_timeouts_waitq); - } - CDEBUG(D_HA|D_WARNING, "activate timeouts %u\n", - atomic_read(&suspend_timeouts)); -#endif -} - -int ptlrpc_check_suspend(void) -{ - if (atomic_read(&suspend_timeouts)) - return 1; - return 0; -} - -int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req) -{ - struct l_wait_info lwi; - - if (atomic_read(&suspend_timeouts)) { - DEBUG_REQ(D_NET, req, "-- suspend %d regular timeout", - atomic_read(&suspend_timeouts)); - lwi = LWI_INTR(NULL, NULL); - l_wait_event(suspend_timeouts_waitq, - atomic_read(&suspend_timeouts) == 0, &lwi); - DEBUG_REQ(D_NET, req, "-- recharge regular timeout"); - return 1; - } - return 0; -} - - static bool ir_up; void ptlrpc_pinger_ir_up(void) @@ -378,7 +314,6 @@ int ptlrpc_start_pinger(void) return -EALREADY; init_waitqueue_head(&pinger_thread.t_ctl_waitq); - init_waitqueue_head(&suspend_timeouts_waitq); strcpy(pinger_thread.t_name, "ll_ping");