Skip to content
Snippets Groups Projects
Commit f674682a authored by Alexey Lyashkov's avatar Alexey Lyashkov
Browse files

timeout and assert in invalidate import.

b=15716
i=rread
i=johann
parent 669174b4
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,13 @@ tbd Sun Microsystems, Inc. ...@@ -24,6 +24,13 @@ tbd Sun Microsystems, Inc.
'tunefs.lustre --param="mdt.quota_type=ug1" $MDTDEV'. 'tunefs.lustre --param="mdt.quota_type=ug1" $MDTDEV'.
For more information, please refer to bugzilla 13904. For more information, please refer to bugzilla 13904.
Severity : minor
Bugzilla : 15716
Description: timeout with invalidate import.
Details : ptlrpcd_check call obd_zombie_impexp_cull and wait request which should be
handled by ptlrpcd. This produce long age waiting and -ETIMEOUT
ptlrpc_invalidate_import and as result LASSERT.
Severity : enhancement Severity : enhancement
Bugzilla : 15741 Bugzilla : 15741
Description: Update to RHEL5 kernel-2.6.18-53.1.19.el5. Description: Update to RHEL5 kernel-2.6.18-53.1.19.el5.
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
#include <linux/timer.h> #include <linux/timer.h>
#endif #endif
void obd_zombie_impexp_init(void);
void obd_zombie_impexp_cull(void);
extern void (*obd_zombie_impexp_notify)(void);
/* obdo.c */ /* obdo.c */
#ifdef __KERNEL__ #ifdef __KERNEL__
void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned ia_valid); void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned ia_valid);
......
...@@ -84,6 +84,10 @@ char *obd_export_nid2str(struct obd_export *exp); ...@@ -84,6 +84,10 @@ char *obd_export_nid2str(struct obd_export *exp);
int obd_export_evict_by_nid(struct obd_device *obd, char *nid); int obd_export_evict_by_nid(struct obd_device *obd, char *nid);
int obd_export_evict_by_uuid(struct obd_device *obd, char *uuid); int obd_export_evict_by_uuid(struct obd_device *obd, char *uuid);
int obd_zombie_impexp_init(void);
void obd_zombie_impexp_stop(void);
void obd_zombie_impexp_cull(void);
/* obd_config.c */ /* obd_config.c */
int class_process_config(struct lustre_cfg *lcfg); int class_process_config(struct lustre_cfg *lcfg);
int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
......
...@@ -610,6 +610,7 @@ static void cleanup_obdclass(void) ...@@ -610,6 +610,7 @@ static void cleanup_obdclass(void)
class_handle_cleanup(); class_handle_cleanup();
class_exit_uuidlist(); class_exit_uuidlist();
obd_zombie_impexp_stop();
memory_leaked = obd_memory_sum(); memory_leaked = obd_memory_sum();
pages_leaked = obd_pages_sum(); pages_leaked = obd_pages_sum();
......
...@@ -45,9 +45,7 @@ cfs_mem_cache_t *import_cachep; ...@@ -45,9 +45,7 @@ cfs_mem_cache_t *import_cachep;
struct list_head obd_zombie_imports; struct list_head obd_zombie_imports;
struct list_head obd_zombie_exports; struct list_head obd_zombie_exports;
spinlock_t obd_zombie_impexp_lock; spinlock_t obd_zombie_impexp_lock;
void (*obd_zombie_impexp_notify)(void) = NULL; static void obd_zombie_impexp_notify(void);
EXPORT_SYMBOL(obd_zombie_impexp_notify);
int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
...@@ -1282,11 +1280,11 @@ int obd_export_evict_by_uuid(struct obd_device *obd, char *uuid) ...@@ -1282,11 +1280,11 @@ int obd_export_evict_by_uuid(struct obd_device *obd, char *uuid)
} }
EXPORT_SYMBOL(obd_export_evict_by_uuid); EXPORT_SYMBOL(obd_export_evict_by_uuid);
void obd_zombie_impexp_cull(void) void obd_zombie_impexp_cull(void)
{ {
struct obd_import *import; struct obd_import *import;
struct obd_export *export; struct obd_export *export;
do { do {
spin_lock (&obd_zombie_impexp_lock); spin_lock (&obd_zombie_impexp_lock);
...@@ -1297,7 +1295,7 @@ void obd_zombie_impexp_cull(void) ...@@ -1297,7 +1295,7 @@ void obd_zombie_impexp_cull(void)
imp_zombie_chain); imp_zombie_chain);
list_del(&import->imp_zombie_chain); list_del(&import->imp_zombie_chain);
} }
export = NULL; export = NULL;
if (!list_empty(&obd_zombie_exports)) { if (!list_empty(&obd_zombie_exports)) {
export = list_entry(obd_zombie_exports.next, export = list_entry(obd_zombie_exports.next,
...@@ -1307,7 +1305,7 @@ void obd_zombie_impexp_cull(void) ...@@ -1307,7 +1305,7 @@ void obd_zombie_impexp_cull(void)
} }
spin_unlock(&obd_zombie_impexp_lock); spin_unlock(&obd_zombie_impexp_lock);
if (import != NULL) if (import != NULL)
class_import_destroy(import); class_import_destroy(import);
...@@ -1316,11 +1314,121 @@ void obd_zombie_impexp_cull(void) ...@@ -1316,11 +1314,121 @@ void obd_zombie_impexp_cull(void)
} while (import != NULL || export != NULL); } while (import != NULL || export != NULL);
} }
EXPORT_SYMBOL(obd_zombie_impexp_cull);
void obd_zombie_impexp_init(void) static struct completion obd_zombie_start;
static struct completion obd_zombie_stop;
static unsigned long obd_zombie_flags;
static cfs_waitq_t obd_zombie_waitq;
enum {
OBD_ZOMBIE_STOP = 1
};
int obd_zombi_impexp_check(void *arg)
{ {
int rc;
spin_lock(&obd_zombie_impexp_lock);
rc = list_empty(&obd_zombie_imports) &&
list_empty(&obd_zombie_exports) &&
!test_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
spin_unlock(&obd_zombie_impexp_lock);
RETURN(rc);
}
static void obd_zombie_impexp_notify(void)
{
cfs_waitq_signal(&obd_zombie_waitq);
}
#ifdef __KERNEL__
static int obd_zombie_impexp_thread(void *unused)
{
int rc;
if ((rc = cfs_daemonize_ctxt("obd_zombid"))) {
complete(&obd_zombie_start);
RETURN(rc);
}
complete(&obd_zombie_start);
while(!test_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags)) {
struct l_wait_info lwi = { 0 };
l_wait_event(obd_zombie_waitq, !obd_zombi_impexp_check(NULL), &lwi);
obd_zombie_impexp_cull();
}
complete(&obd_zombie_stop);
RETURN(0);
}
#else /* ! KERNEL */
static atomic_t zombi_recur = ATOMIC_INIT(0);
static void *obd_zombi_impexp_work_cb;
static void *obd_zombi_impexp_idle_cb;
int obd_zombi_impexp_kill(void *arg)
{
int rc = 0;
if (atomic_inc_return(&zombi_recur) == 1) {
obd_zombie_impexp_cull();
rc = 1;
}
atomic_dec(&zombi_recur);
return rc;
}
#endif
int obd_zombie_impexp_init(void)
{
int rc;
CFS_INIT_LIST_HEAD(&obd_zombie_imports); CFS_INIT_LIST_HEAD(&obd_zombie_imports);
CFS_INIT_LIST_HEAD(&obd_zombie_exports); CFS_INIT_LIST_HEAD(&obd_zombie_exports);
spin_lock_init(&obd_zombie_impexp_lock); spin_lock_init(&obd_zombie_impexp_lock);
init_completion(&obd_zombie_start);
init_completion(&obd_zombie_stop);
cfs_waitq_init(&obd_zombie_waitq);
#ifdef __KERNEL__
rc = cfs_kernel_thread(obd_zombie_impexp_thread, NULL, 0);
if (rc < 0)
RETURN(rc);
wait_for_completion(&obd_zombie_start);
#else
obd_zombi_impexp_work_cb =
liblustre_register_wait_callback("obd_zombi_impexp_kill",
&obd_zombi_impexp_kill, NULL);
obd_zombi_impexp_idle_cb =
liblustre_register_idle_callback("obd_zombi_impexp_check",
&obd_zombi_impexp_check, NULL);
rc = 0;
#endif
RETURN(rc);
}
void obd_zombie_impexp_stop(void)
{
set_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
obd_zombie_impexp_notify();
#ifdef __KERNEL__
wait_for_completion(&obd_zombie_stop);
#else
liblustre_deregister_wait_callback(obd_zombi_impexp_work_cb);
liblustre_deregister_idle_callback(obd_zombi_impexp_idle_cb);
#endif
} }
...@@ -359,10 +359,10 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg) ...@@ -359,10 +359,10 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg)
obd->obd_name, obd->obd_uuid.uuid); obd->obd_name, obd->obd_uuid.uuid);
class_decref(obd); class_decref(obd);
/* not strictly necessary, but cleans up eagerly */ /* not strictly necessary, but cleans up eagerly */
obd_zombie_impexp_cull(); obd_zombie_impexp_cull();
RETURN(0); RETURN(0);
} }
......
...@@ -234,6 +234,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp) ...@@ -234,6 +234,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
DEBUG_REQ(D_ERROR, req, "still on delayed list"); DEBUG_REQ(D_ERROR, req, "still on delayed list");
} }
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
LASSERT(atomic_read(&imp->imp_inflight) == 0);
} }
out: out:
......
...@@ -97,8 +97,6 @@ static int ptlrpcd_check(struct ptlrpcd_ctl *pc) ...@@ -97,8 +97,6 @@ static int ptlrpcd_check(struct ptlrpcd_ctl *pc)
if (test_bit(LIOD_STOP, &pc->pc_flags)) if (test_bit(LIOD_STOP, &pc->pc_flags))
RETURN(1); RETURN(1);
obd_zombie_impexp_cull();
spin_lock(&pc->pc_set->set_new_req_lock); spin_lock(&pc->pc_set->set_new_req_lock);
list_for_each_safe(pos, tmp, &pc->pc_set->set_new_requests) { list_for_each_safe(pos, tmp, &pc->pc_set->set_new_requests) {
req = list_entry(pos, struct ptlrpc_request, rq_set_chain); req = list_entry(pos, struct ptlrpc_request, rq_set_chain);
...@@ -176,13 +174,6 @@ static int ptlrpcd(void *arg) ...@@ -176,13 +174,6 @@ static int ptlrpcd(void *arg)
return 0; return 0;
} }
static void ptlrpcd_zombie_impexp_notify(void)
{
LASSERT(ptlrpcd_pc.pc_set != NULL); // call before ptlrpcd inited ?
cfs_waitq_signal(&ptlrpcd_pc.pc_set->set_waitq);
}
#else #else
int ptlrpcd_check_async_rpcs(void *arg) int ptlrpcd_check_async_rpcs(void *arg)
...@@ -233,9 +224,6 @@ static int ptlrpcd_start(char *name, struct ptlrpcd_ctl *pc) ...@@ -233,9 +224,6 @@ static int ptlrpcd_start(char *name, struct ptlrpcd_ctl *pc)
RETURN(-ENOMEM); RETURN(-ENOMEM);
#ifdef __KERNEL__ #ifdef __KERNEL__
/* wake ptlrpcd when zombie imports or exports exist */
obd_zombie_impexp_notify = ptlrpcd_zombie_impexp_notify;
rc = cfs_kernel_thread(ptlrpcd, pc, 0); rc = cfs_kernel_thread(ptlrpcd, pc, 0);
if (rc < 0) { if (rc < 0) {
ptlrpc_set_destroy(pc->pc_set); ptlrpc_set_destroy(pc->pc_set);
...@@ -260,7 +248,6 @@ static void ptlrpcd_stop(struct ptlrpcd_ctl *pc) ...@@ -260,7 +248,6 @@ static void ptlrpcd_stop(struct ptlrpcd_ctl *pc)
set_bit(LIOD_STOP, &pc->pc_flags); set_bit(LIOD_STOP, &pc->pc_flags);
cfs_waitq_signal(&pc->pc_set->set_waitq); cfs_waitq_signal(&pc->pc_set->set_waitq);
#ifdef __KERNEL__ #ifdef __KERNEL__
obd_zombie_impexp_notify = NULL;
wait_for_completion(&pc->pc_finishing); wait_for_completion(&pc->pc_finishing);
#else #else
liblustre_deregister_wait_callback(pc->pc_wait_callback); liblustre_deregister_wait_callback(pc->pc_wait_callback);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment