From: phil Date: Mon, 13 Oct 2003 22:31:02 +0000 (+0000) Subject: The pinger was deadlocking on itself, in some rare and improbably but X-Git-Tag: v1_7_0_51~2^9~248 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1217bde96ab9949d28a854c7600f13967f0cb44d;p=fs%2Flustre-release.git The pinger was deadlocking on itself, in some rare and improbably but very real cases, so I reworked it to be simpler. It's started once from ptlrpc_init now, and stopped once from ptlrpc_exit Adding and deleting imports no longer causes the thread to be created and go away. Most importantly, we no longer hold the sem in stop_pinger across the wake_up and subsequent l_wait_event; if the pinger thread was already doing something, blocked on the pinger_sem, it would never wake up and deadlock would ensue. --- diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index cfb2b55..cdf6f69 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -98,5 +98,9 @@ enum { int ptlrpc_expire_one_request(struct ptlrpc_request *req); +/* pinger.c */ +int ptlrpc_start_pinger(void); +int ptlrpc_stop_pinger(void); void ptlrpc_pinger_sending_on_import(struct obd_import *imp); + #endif /* PTLRPC_INTERNAL_H */ diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index 8486b76..d0a8da5 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -113,11 +113,14 @@ __init int ptlrpc_init(void) ptlrpc_put_connection_superhack = ptlrpc_put_connection; ptlrpc_abort_inflight_superhack = ptlrpc_abort_inflight; + + ptlrpc_start_pinger(); RETURN(0); } static void __exit ptlrpc_exit(void) { + ptlrpc_stop_pinger(); ptlrpc_exit_portals(); ptlrpc_cleanup_connection(); llog_cleanup_commit_master(0);