From f0bdb5d2a0e95ba70590462e60ccdbc97cd09784 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 4 Jun 2003 21:34:50 +0000 Subject: [PATCH] Merge from b_devel -> b_orphan DEVEL_ORPHAN_UPDATE_PARENT_20030528 -> DEVEL_ORPHAN_UPDATE_PARENT_20030604 This is a non-functional commit, with osc/osc_request.c not compiling because it is missing the "llog_commit_master" data struct, and does not have any commit threads started yet. I'm beginning to think the right thing to do here is to create a single global llog_commit_master struct for the OSC, and start a single thread at module setup time, and clean it all up at module unload time, but I could be convinced otherwise. --- lnet/Makefile.am | 2 +- lnet/doc/ieee.bst | 2 -- lnet/doc/portals3.lyx | 2 -- lnet/include/linux/kp30.h | 12 +++++++----- lnet/include/lnet/defines.h | 1 - lnet/include/lnet/internal.h | 3 --- lnet/include/lnet/lib-lnet.h | 10 +++++----- lnet/include/lnet/lib-p30.h | 10 +++++----- lnet/include/lnet/myrnal.h | 4 ---- lnet/include/lnet/nal.h | 3 --- lnet/include/lnet/ppid.h | 4 ---- lnet/include/lnet/stringtab.h | 3 --- lnet/libcfs/debug.c | 17 +++++++++++++---- lnet/libcfs/module.c | 2 +- lustre/portals/Makefile.am | 2 +- lustre/portals/doc/ieee.bst | 2 -- lustre/portals/doc/portals3.lyx | 2 -- lustre/portals/include/linux/kp30.h | 12 +++++++----- lustre/portals/include/portals/defines.h | 1 - lustre/portals/include/portals/lib-p30.h | 10 +++++----- lustre/portals/include/portals/myrnal.h | 4 ---- lustre/portals/include/portals/nal.h | 3 --- lustre/portals/include/portals/ppid.h | 4 ---- lustre/portals/include/portals/stringtab.h | 3 --- lustre/portals/libcfs/debug.c | 17 +++++++++++++---- lustre/portals/libcfs/module.c | 2 +- lustre/scripts/llite-group.sh | 2 +- 27 files changed, 60 insertions(+), 79 deletions(-) diff --git a/lnet/Makefile.am b/lnet/Makefile.am index 26293f2..1a223f2 100644 --- a/lnet/Makefile.am +++ b/lnet/Makefile.am @@ -3,7 +3,7 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -EXTRA_DIST = Rules.linux archdep.m4 +EXTRA_DIST = Rules.linux archdep.m4 include DIST_SUBDIRS = libcfs portals knals unals utils tests doc router if LIBLUSTRE SUBDIRS = portals unals utils diff --git a/lnet/doc/ieee.bst b/lnet/doc/ieee.bst index c3d0150..4df7c50 100644 --- a/lnet/doc/ieee.bst +++ b/lnet/doc/ieee.bst @@ -1,7 +1,5 @@ % --------------------------------------------------------------- % -% $Id: ieee.bst,v 1.1.8.1 2003/05/23 07:02:28 adilger Exp $ -% % by Paolo.Ienne@di.epfl.ch % % --------------------------------------------------------------- diff --git a/lnet/doc/portals3.lyx b/lnet/doc/portals3.lyx index 65e02bf..8429280 100644 --- a/lnet/doc/portals3.lyx +++ b/lnet/doc/portals3.lyx @@ -7,8 +7,6 @@ {\begin{quote}\textbf{Discussion}: \slshape}% {\end{quote}} \pagestyle{myheadings} -\markboth{$Revision: 1.1.8.1 $\hfil$Date: 2003/05/23 07:02:29 $}% -{$Date: 2003/05/23 07:02:29 $\hfil$Revision: 1.1.8.1 $} \end_preamble \language american \inputencoding auto diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index c5ff808..b21167a 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -116,7 +116,7 @@ do { \ portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \ portals_debug_msg(DEBUG_SUBSYSTEM, mask, \ __FILE__, __FUNCTION__, __LINE__, \ - CDEBUG_STACK(), format , ## a); \ + CDEBUG_STACK(), format, ## a); \ } while (0) #define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a) @@ -216,24 +216,26 @@ extern void kportal_assertion_failed(char *expr,char *file,char *func,int line); #endif #ifdef __arch_um__ -#define LBUG() \ +#define LBUG_WITH_LOC(file, func, line) \ do { \ CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ portals_debug_dumplog(); \ - portals_run_lbug_upcall(__FILE__, __FUNCTION__, __LINE__); \ + portals_run_lbug_upcall(file, func, line); \ panic("LBUG"); \ } while (0) #else -#define LBUG() \ +#define LBUG_WITH_LOC(file, func, line) \ do { \ CEMERG("LBUG\n"); \ portals_debug_dumplog(); \ - portals_run_lbug_upcall(__FILE__, __FUNCTION__, __LINE__); \ + portals_run_lbug_upcall(file, func, line); \ set_task_state(current, TASK_UNINTERRUPTIBLE); \ schedule(); \ } while (0) #endif /* __arch_um__ */ +#define LBUG() LBUG_WITH_LOC(__FILE__, __FUNCTION__, __LINE__) + /* * Memory */ diff --git a/lnet/include/lnet/defines.h b/lnet/include/lnet/defines.h index 62e888f..785ce73 100644 --- a/lnet/include/lnet/defines.h +++ b/lnet/include/lnet/defines.h @@ -1,5 +1,4 @@ /* -** $Id: defines.h,v 1.1.8.1 2003/05/23 07:02:35 adilger Exp $ ** ** This files contains definitions that are used throughout the cplant code. */ diff --git a/lnet/include/lnet/internal.h b/lnet/include/lnet/internal.h index b5e4098..a70b465 100644 --- a/lnet/include/lnet/internal.h +++ b/lnet/include/lnet/internal.h @@ -1,6 +1,3 @@ -/* -** $Id: internal.h,v 1.1.8.1 2003/05/23 07:02:35 adilger Exp $ -*/ #ifndef _P30_INTERNAL_H_ #define _P30_INTERNAL_H_ diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 4a61e76..ca92e5f 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -170,10 +170,10 @@ lib_msg_free (nal_cb_t *nal, lib_msg_t *msg) #else -extern kmem_cache_t *ptl_md_slab; -extern kmem_cache_t *ptl_msg_slab; -extern kmem_cache_t *ptl_me_slab; -extern kmem_cache_t *ptl_eq_slab; +extern kmem_cache_t *ptl_md_slab; +extern kmem_cache_t *ptl_msg_slab; +extern kmem_cache_t *ptl_me_slab; +extern kmem_cache_t *ptl_eq_slab; extern atomic_t md_in_use_count; extern atomic_t msg_in_use_count; extern atomic_t me_in_use_count; @@ -246,7 +246,7 @@ static inline lib_msg_t * lib_msg_alloc(nal_cb_t *nal) { /* ALWAYS called with statelock held */ - lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); + lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); if (msg == NULL) return (NULL); diff --git a/lnet/include/lnet/lib-p30.h b/lnet/include/lnet/lib-p30.h index 4a61e76..ca92e5f 100644 --- a/lnet/include/lnet/lib-p30.h +++ b/lnet/include/lnet/lib-p30.h @@ -170,10 +170,10 @@ lib_msg_free (nal_cb_t *nal, lib_msg_t *msg) #else -extern kmem_cache_t *ptl_md_slab; -extern kmem_cache_t *ptl_msg_slab; -extern kmem_cache_t *ptl_me_slab; -extern kmem_cache_t *ptl_eq_slab; +extern kmem_cache_t *ptl_md_slab; +extern kmem_cache_t *ptl_msg_slab; +extern kmem_cache_t *ptl_me_slab; +extern kmem_cache_t *ptl_eq_slab; extern atomic_t md_in_use_count; extern atomic_t msg_in_use_count; extern atomic_t me_in_use_count; @@ -246,7 +246,7 @@ static inline lib_msg_t * lib_msg_alloc(nal_cb_t *nal) { /* ALWAYS called with statelock held */ - lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); + lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); if (msg == NULL) return (NULL); diff --git a/lnet/include/lnet/myrnal.h b/lnet/include/lnet/myrnal.h index bec3d64..13790f7 100644 --- a/lnet/include/lnet/myrnal.h +++ b/lnet/include/lnet/myrnal.h @@ -1,7 +1,3 @@ -/* -** $Id: myrnal.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ - #ifndef MYRNAL_H #define MYRNAL_H diff --git a/lnet/include/lnet/nal.h b/lnet/include/lnet/nal.h index 18f0a9a..7cb3ab7 100644 --- a/lnet/include/lnet/nal.h +++ b/lnet/include/lnet/nal.h @@ -1,6 +1,3 @@ -/* -** $Id: nal.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ #ifndef _NAL_H_ #define _NAL_H_ diff --git a/lnet/include/lnet/ppid.h b/lnet/include/lnet/ppid.h index 973c8df..760f465 100644 --- a/lnet/include/lnet/ppid.h +++ b/lnet/include/lnet/ppid.h @@ -1,7 +1,3 @@ -/* - * TITLE(ppid_h, "@(#) $Id: ppid.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $"); - */ - #ifndef _INCppidh_ #define _INCppidh_ diff --git a/lnet/include/lnet/stringtab.h b/lnet/include/lnet/stringtab.h index 74bd960..33e4375 100644 --- a/lnet/include/lnet/stringtab.h +++ b/lnet/include/lnet/stringtab.h @@ -1,6 +1,3 @@ /* -** $Id: stringtab.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ -/* * stringtab.h */ diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 6233b8d..8d26dbb 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -237,7 +237,8 @@ int portals_do_debug_dumplog(void *arg) file = filp_open(debug_file_name, O_CREAT|O_TRUNC|O_RDWR, 0644); if (!file || IS_ERR(file)) { - CERROR("cannot open %s for dumping", debug_file_name); + CERROR("cannot open %s for dumping: %ld\n", debug_file_name, + PTR_ERR(file)); GOTO(out, PTR_ERR(file)); } else { printk(KERN_ALERT "dumping log to %s ... writing ...\n", @@ -274,7 +275,7 @@ int portals_debug_daemon(void *arg) void *journal_info; mm_segment_t oldfs; unsigned long force_flush = 0; - unsigned long size; + unsigned long size, off, flags; int rc; kportal_daemonize("ldebug_daemon"); @@ -295,7 +296,17 @@ int portals_debug_daemon(void *arg) debug_daemon_state.overlapped = 0; debug_daemon_state.stopped = 0; + + spin_lock_irqsave(&portals_debug_lock, flags); + off = atomic_read(&debug_off_a) + 1; + if (debug_wrapped) + off = (off >= debug_size)? 0 : off; + else + off = 0; + atomic_set(&debug_daemon_next_write, off); atomic_set(&debug_daemon_state.paused, 0); + spin_unlock_irqrestore(&portals_debug_lock, flags); + oldfs = get_fs(); set_fs(KERNEL_DS); while (1) { @@ -431,8 +442,6 @@ int portals_debug_daemon_start(char *file, unsigned int size) init_waitqueue_head(&debug_daemon_state.lctl); init_waitqueue_head(&debug_daemon_state.daemon); - atomic_set(&debug_daemon_next_write, atomic_read(&debug_off_a)); - daemon_file_size_limit = size << 20; debug_daemon_state.lctl_event = 0; diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index c4ca2e3..5e3fcb5 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -67,7 +67,7 @@ kportal_assertion_failed (char *expr, char *file, char *func, int line) { portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif diff --git a/lustre/portals/Makefile.am b/lustre/portals/Makefile.am index 26293f2..1a223f2 100644 --- a/lustre/portals/Makefile.am +++ b/lustre/portals/Makefile.am @@ -3,7 +3,7 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -EXTRA_DIST = Rules.linux archdep.m4 +EXTRA_DIST = Rules.linux archdep.m4 include DIST_SUBDIRS = libcfs portals knals unals utils tests doc router if LIBLUSTRE SUBDIRS = portals unals utils diff --git a/lustre/portals/doc/ieee.bst b/lustre/portals/doc/ieee.bst index c3d0150..4df7c50 100644 --- a/lustre/portals/doc/ieee.bst +++ b/lustre/portals/doc/ieee.bst @@ -1,7 +1,5 @@ % --------------------------------------------------------------- % -% $Id: ieee.bst,v 1.1.8.1 2003/05/23 07:02:28 adilger Exp $ -% % by Paolo.Ienne@di.epfl.ch % % --------------------------------------------------------------- diff --git a/lustre/portals/doc/portals3.lyx b/lustre/portals/doc/portals3.lyx index 65e02bf..8429280 100644 --- a/lustre/portals/doc/portals3.lyx +++ b/lustre/portals/doc/portals3.lyx @@ -7,8 +7,6 @@ {\begin{quote}\textbf{Discussion}: \slshape}% {\end{quote}} \pagestyle{myheadings} -\markboth{$Revision: 1.1.8.1 $\hfil$Date: 2003/05/23 07:02:29 $}% -{$Date: 2003/05/23 07:02:29 $\hfil$Revision: 1.1.8.1 $} \end_preamble \language american \inputencoding auto diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index c5ff808..b21167a 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -116,7 +116,7 @@ do { \ portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \ portals_debug_msg(DEBUG_SUBSYSTEM, mask, \ __FILE__, __FUNCTION__, __LINE__, \ - CDEBUG_STACK(), format , ## a); \ + CDEBUG_STACK(), format, ## a); \ } while (0) #define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a) @@ -216,24 +216,26 @@ extern void kportal_assertion_failed(char *expr,char *file,char *func,int line); #endif #ifdef __arch_um__ -#define LBUG() \ +#define LBUG_WITH_LOC(file, func, line) \ do { \ CEMERG("LBUG - trying to dump log to /tmp/lustre-log\n"); \ portals_debug_dumplog(); \ - portals_run_lbug_upcall(__FILE__, __FUNCTION__, __LINE__); \ + portals_run_lbug_upcall(file, func, line); \ panic("LBUG"); \ } while (0) #else -#define LBUG() \ +#define LBUG_WITH_LOC(file, func, line) \ do { \ CEMERG("LBUG\n"); \ portals_debug_dumplog(); \ - portals_run_lbug_upcall(__FILE__, __FUNCTION__, __LINE__); \ + portals_run_lbug_upcall(file, func, line); \ set_task_state(current, TASK_UNINTERRUPTIBLE); \ schedule(); \ } while (0) #endif /* __arch_um__ */ +#define LBUG() LBUG_WITH_LOC(__FILE__, __FUNCTION__, __LINE__) + /* * Memory */ diff --git a/lustre/portals/include/portals/defines.h b/lustre/portals/include/portals/defines.h index 62e888f..785ce73 100644 --- a/lustre/portals/include/portals/defines.h +++ b/lustre/portals/include/portals/defines.h @@ -1,5 +1,4 @@ /* -** $Id: defines.h,v 1.1.8.1 2003/05/23 07:02:35 adilger Exp $ ** ** This files contains definitions that are used throughout the cplant code. */ diff --git a/lustre/portals/include/portals/lib-p30.h b/lustre/portals/include/portals/lib-p30.h index 4a61e76..ca92e5f 100644 --- a/lustre/portals/include/portals/lib-p30.h +++ b/lustre/portals/include/portals/lib-p30.h @@ -170,10 +170,10 @@ lib_msg_free (nal_cb_t *nal, lib_msg_t *msg) #else -extern kmem_cache_t *ptl_md_slab; -extern kmem_cache_t *ptl_msg_slab; -extern kmem_cache_t *ptl_me_slab; -extern kmem_cache_t *ptl_eq_slab; +extern kmem_cache_t *ptl_md_slab; +extern kmem_cache_t *ptl_msg_slab; +extern kmem_cache_t *ptl_me_slab; +extern kmem_cache_t *ptl_eq_slab; extern atomic_t md_in_use_count; extern atomic_t msg_in_use_count; extern atomic_t me_in_use_count; @@ -246,7 +246,7 @@ static inline lib_msg_t * lib_msg_alloc(nal_cb_t *nal) { /* ALWAYS called with statelock held */ - lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); + lib_msg_t *msg = kmem_cache_alloc(ptl_msg_slab, GFP_ATOMIC); if (msg == NULL) return (NULL); diff --git a/lustre/portals/include/portals/myrnal.h b/lustre/portals/include/portals/myrnal.h index bec3d64..13790f7 100644 --- a/lustre/portals/include/portals/myrnal.h +++ b/lustre/portals/include/portals/myrnal.h @@ -1,7 +1,3 @@ -/* -** $Id: myrnal.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ - #ifndef MYRNAL_H #define MYRNAL_H diff --git a/lustre/portals/include/portals/nal.h b/lustre/portals/include/portals/nal.h index 18f0a9a..7cb3ab7 100644 --- a/lustre/portals/include/portals/nal.h +++ b/lustre/portals/include/portals/nal.h @@ -1,6 +1,3 @@ -/* -** $Id: nal.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ #ifndef _NAL_H_ #define _NAL_H_ diff --git a/lustre/portals/include/portals/ppid.h b/lustre/portals/include/portals/ppid.h index 973c8df..760f465 100644 --- a/lustre/portals/include/portals/ppid.h +++ b/lustre/portals/include/portals/ppid.h @@ -1,7 +1,3 @@ -/* - * TITLE(ppid_h, "@(#) $Id: ppid.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $"); - */ - #ifndef _INCppidh_ #define _INCppidh_ diff --git a/lustre/portals/include/portals/stringtab.h b/lustre/portals/include/portals/stringtab.h index 74bd960..33e4375 100644 --- a/lustre/portals/include/portals/stringtab.h +++ b/lustre/portals/include/portals/stringtab.h @@ -1,6 +1,3 @@ /* -** $Id: stringtab.h,v 1.1.8.1 2003/05/23 07:02:36 adilger Exp $ -*/ -/* * stringtab.h */ diff --git a/lustre/portals/libcfs/debug.c b/lustre/portals/libcfs/debug.c index 6233b8d..8d26dbb 100644 --- a/lustre/portals/libcfs/debug.c +++ b/lustre/portals/libcfs/debug.c @@ -237,7 +237,8 @@ int portals_do_debug_dumplog(void *arg) file = filp_open(debug_file_name, O_CREAT|O_TRUNC|O_RDWR, 0644); if (!file || IS_ERR(file)) { - CERROR("cannot open %s for dumping", debug_file_name); + CERROR("cannot open %s for dumping: %ld\n", debug_file_name, + PTR_ERR(file)); GOTO(out, PTR_ERR(file)); } else { printk(KERN_ALERT "dumping log to %s ... writing ...\n", @@ -274,7 +275,7 @@ int portals_debug_daemon(void *arg) void *journal_info; mm_segment_t oldfs; unsigned long force_flush = 0; - unsigned long size; + unsigned long size, off, flags; int rc; kportal_daemonize("ldebug_daemon"); @@ -295,7 +296,17 @@ int portals_debug_daemon(void *arg) debug_daemon_state.overlapped = 0; debug_daemon_state.stopped = 0; + + spin_lock_irqsave(&portals_debug_lock, flags); + off = atomic_read(&debug_off_a) + 1; + if (debug_wrapped) + off = (off >= debug_size)? 0 : off; + else + off = 0; + atomic_set(&debug_daemon_next_write, off); atomic_set(&debug_daemon_state.paused, 0); + spin_unlock_irqrestore(&portals_debug_lock, flags); + oldfs = get_fs(); set_fs(KERNEL_DS); while (1) { @@ -431,8 +442,6 @@ int portals_debug_daemon_start(char *file, unsigned int size) init_waitqueue_head(&debug_daemon_state.lctl); init_waitqueue_head(&debug_daemon_state.daemon); - atomic_set(&debug_daemon_next_write, atomic_read(&debug_off_a)); - daemon_file_size_limit = size << 20; debug_daemon_state.lctl_event = 0; diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index c4ca2e3..5e3fcb5 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -67,7 +67,7 @@ kportal_assertion_failed (char *expr, char *file, char *func, int line) { portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif diff --git a/lustre/scripts/llite-group.sh b/lustre/scripts/llite-group.sh index 879a858..ed914e8 100644 --- a/lustre/scripts/llite-group.sh +++ b/lustre/scripts/llite-group.sh @@ -36,7 +36,7 @@ start() { stop() { echo -n "Shutting down $SERVICE: " - python2 $LCONF -v --cleanup --failover $confopt + python2 $LCONF -v --cleanup --force --failover $confopt RETVAL=$? echo done } -- 1.8.3.1