From: rread Date: Thu, 5 Jun 2003 04:12:57 +0000 (+0000) Subject: merge from b_devel -> b_ad X-Git-Tag: v1_7_100~1^90~41 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=80f0fe98e7fed340a16c80ceffde3524258b7d58;p=fs%2Flustre-release.git merge from b_devel -> b_ad DEVEL_AD_PARENT_20030526 -> DEVEL_AD_PARENT_20030605 Large, squirrelly merge. It mounts, and acceptance_small.sh finishes the test and then fails in cleanup, just like b_devel. --- diff --git a/lnet/Makefile.am b/lnet/Makefile.am index 9c84d8e..1a223f2 100644 --- a/lnet/Makefile.am +++ b/lnet/Makefile.am @@ -3,8 +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 MCP -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/archdep.m4 b/lnet/archdep.m4 index 3a433be..1b93d37 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -150,7 +150,7 @@ fi # ------------ include paths ------------------ if test $host_cpu != "lib" ; then - KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include -I$(LINUX)/include' + KINCFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include -I$LINUX/include" else KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include' fi @@ -303,4 +303,20 @@ AC_SUBST(MOD_LINK) AC_SUBST(LINUX25) AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) +# ---------- Red Hat 2.4.20 backports some 2.5 bits -------- +# This needs to run after we've defined the KCPPFLAGS +AC_MSG_CHECKING(for kernel version) +AC_TRY_LINK([#define __KERNEL__ + #include ], + [struct task_struct p; + p.sighand = NULL;], + [RH_2_4_20=1], + [RH_2_4_20=0]) + +if test $RH_2_4_20 = 1; then + AC_MSG_RESULT(redhat-2.4.20) + CPPFLAGS="$CPPFLAGS -DCONFIG_RH_2_4_20" +else + AC_MSG_RESULT($RELEASE) +fi diff --git a/lnet/doc/ieee.bst b/lnet/doc/ieee.bst index 5367caa..4df7c50 100644 --- a/lnet/doc/ieee.bst +++ b/lnet/doc/ieee.bst @@ -1,7 +1,5 @@ % --------------------------------------------------------------- % -% $Id: ieee.bst,v 1.1.2.1 2003/05/19 04:25:30 braam Exp $ -% % by Paolo.Ienne@di.epfl.ch % % --------------------------------------------------------------- diff --git a/lnet/doc/portals3.lyx b/lnet/doc/portals3.lyx index f3c24e0..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.2.1 $\hfil$Date: 2003/05/19 04:25:30 $}% -{$Date: 2003/05/19 04:25:30 $\hfil$Revision: 1.1.2.1 $} \end_preamble \language american \inputencoding auto diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index 64fdb1c..9a3e64a 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -83,45 +83,40 @@ extern unsigned int portal_printk; #ifdef __KERNEL__ # include /* THREAD_SIZE */ -#ifdef __arch_ia64__ -#define CDEBUG_STACK(var) (&var & (THREAD_SIZE - 1)) +#ifdef __ia64__ +#define CDEBUG_STACK() ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1)) #else -#define CDEBUG_STACK(var) (THREAD_SIZE - \ - ((unsigned long)__builtin_frame_address(0)& \ - (THREAD_SIZE - 1))) +#define CDEBUG_STACK() (THREAD_SIZE - \ + ((unsigned long)__builtin_frame_address(0) & \ + (THREAD_SIZE - 1))) #endif #define CHECK_STACK(stack) \ do { \ - if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) \ + if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \ portals_debug_msg(DEBUG_SUBSYSTEM, D_ERROR, \ __FILE__, __FUNCTION__, __LINE__, \ (stack), \ "maximum lustre stack %u\n", \ portal_stack = (stack)); \ + /*panic("LBUG");*/ \ + } \ } while (0) #else #define CHECK_STACK(stack) do{}while(0) #define CDEBUG_STACK(var) (0) #endif +#if 1 #define CDEBUG(mask, format, a...) \ do { \ - unsigned long stack = CDEBUG_STACK(stack); \ - int match = 0; \ - \ - CHECK_STACK(stack); \ - if (!(mask)) \ - match = 1; \ - else if ((mask) & (D_ERROR | D_EMERG)) \ - match = 1; \ - else if (portal_debug & (mask) && \ - portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24))) \ - match = 1; \ - if (match) \ + CHECK_STACK(CDEBUG_STACK()); \ + if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \ + (portal_debug & (mask) && \ + portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \ portals_debug_msg(DEBUG_SUBSYSTEM, mask, \ __FILE__, __FUNCTION__, __LINE__, \ - stack, format , ## a); \ + CDEBUG_STACK(), format , ## a); \ } while (0) #define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a) @@ -140,10 +135,8 @@ do { \ #define RETURN(rc) \ do { \ typeof(rc) RETURN__ret = (rc); \ - long tmp = (long)RETURN__ret; \ CDEBUG(D_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ - (unsigned long)tmp, (signed long)tmp, \ - (signed long)tmp); \ + (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret);\ return RETURN__ret; \ } while (0) @@ -156,6 +149,16 @@ do { \ do { \ CDEBUG(D_TRACE, "Process leaving\n"); \ } while(0) +#else +#define CDEBUG(mask, format, a...) do { } while (0) +#define CWARN(format, a...) do { } while (0) +#define CERROR(format, a...) printk("<3>" format, ## a) +#define CEMERG(format, a...) printk("<0>" format, ## a) +#define GOTO(label, rc) do { (void)(rc); goto label; } while (0) +#define RETURN(rc) return (rc) +#define ENTRY do { } while (0) +#define EXIT do { } while (0) +#endif #ifdef __KERNEL__ @@ -214,24 +217,26 @@ extern void kportal_assertion_failed(char *expr, char *file, #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 285f7e0..785ce73 100644 --- a/lnet/include/lnet/defines.h +++ b/lnet/include/lnet/defines.h @@ -1,5 +1,4 @@ /* -** $Id: defines.h,v 1.1.2.1 2003/05/19 04:25:31 braam 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 8ade444..d78cad4 100644 --- a/lnet/include/lnet/internal.h +++ b/lnet/include/lnet/internal.h @@ -1,5 +1,4 @@ /* -** $Id: internal.h,v 1.1.2.1 2003/05/19 04:25:31 braam 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/list.h b/lnet/include/lnet/list.h index 41613ab..2b63312 100644 --- a/lnet/include/lnet/list.h +++ b/lnet/include/lnet/list.h @@ -233,14 +233,13 @@ static inline void list_splice_init(struct list_head *list, /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop counter. - * @n: the &struct list_head to use as temporary storage + * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_struct within the struct. */ -#define list_for_each_entry_safe(pos, n, head, member) \ +#define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ - n = pos->member.next; \ + n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ - pos = list_entry(n, typeof(*pos), member), \ - n = pos->member.next) + pos = n, n = list_entry(n->member.next, typeof(*n), member)) #endif diff --git a/lnet/include/lnet/myrnal.h b/lnet/include/lnet/myrnal.h index 6a61fd5..12b1925 100644 --- a/lnet/include/lnet/myrnal.h +++ b/lnet/include/lnet/myrnal.h @@ -1,5 +1,4 @@ /* -** $Id: myrnal.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ #ifndef MYRNAL_H diff --git a/lnet/include/lnet/nal.h b/lnet/include/lnet/nal.h index c1c50ed..88be63c 100644 --- a/lnet/include/lnet/nal.h +++ b/lnet/include/lnet/nal.h @@ -1,5 +1,4 @@ /* -** $Id: nal.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ #ifndef _NAL_H_ #define _NAL_H_ diff --git a/lnet/include/lnet/ppid.h b/lnet/include/lnet/ppid.h index 34e5dc5..4727599 100644 --- a/lnet/include/lnet/ppid.h +++ b/lnet/include/lnet/ppid.h @@ -1,5 +1,4 @@ /* - * TITLE(ppid_h, "@(#) $Id: ppid.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $"); */ #ifndef _INCppidh_ diff --git a/lnet/include/lnet/stringtab.h b/lnet/include/lnet/stringtab.h index 65ab189..c9683f7 100644 --- a/lnet/include/lnet/stringtab.h +++ b/lnet/include/lnet/stringtab.h @@ -1,5 +1,4 @@ /* -** $Id: stringtab.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ /* * stringtab.h diff --git a/lnet/klnds/Makefile.am b/lnet/klnds/Makefile.am index 5c6085e..fed2785 100644 --- a/lnet/klnds/Makefile.am +++ b/lnet/klnds/Makefile.am @@ -3,4 +3,5 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution +DIST_SUBDIRS= socknal toenal qswnal gmnal scimacnal SUBDIRS= socknal toenal @QSWNAL@ @GMNAL@ @SCIMACNAL@ diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h index 5c6cfa7..be94bbb 100644 --- a/lnet/klnds/socklnd/socklnd.h +++ b/lnet/klnds/socklnd/socklnd.h @@ -273,9 +273,9 @@ extern void ksocknal_close_conn (ksock_conn_t *conn); static inline void ksocknal_put_conn (ksock_conn_t *conn) { - CDEBUG (D_OTHER, "putting conn[%p] -> "LPX64" (%d)\n", + CDEBUG (D_OTHER, "putting conn[%p] -> "LPX64" (%d)\n", conn, conn->ksnc_peernid, atomic_read (&conn->ksnc_refcount)); - + if (atomic_dec_and_test (&conn->ksnc_refcount)) _ksocknal_put_conn (conn); } diff --git a/lnet/klnds/socklnd/socklnd_cb.c b/lnet/klnds/socklnd/socklnd_cb.c index 153ac84..16ee04a 100644 --- a/lnet/klnds/socklnd/socklnd_cb.c +++ b/lnet/klnds/socklnd/socklnd_cb.c @@ -740,15 +740,16 @@ ksocknal_setup_hdr (nal_cb_t *nal, void *private, lib_msg_t *cookie, } int -ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, +ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, ptl_hdr_t *hdr, int type, ptl_nid_t nid, ptl_pid_t pid, - unsigned int payload_niov, struct iovec *payload_iov, size_t payload_len) + unsigned int payload_niov, struct iovec *payload_iov, + size_t payload_len) { ksock_ltx_t *ltx; ksock_conn_t *conn; - + /* NB 'private' is different depending on what we're sending. - * Just ignore it until we can rely on it + * Just ignore it until we can rely on it * * Also, the return code from this procedure is ignored. * If we can't send, we must still complete with lib_finalize(). @@ -756,31 +757,31 @@ ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, */ CDEBUG(D_NET, - "sending "LPSZ" bytes in %d mapped frags to nid: "LPX64" pid %d\n", - payload_len, payload_niov, nid, pid); + "sending "LPSZ" bytes in %d mapped frags to nid: "LPX64 + " pid %d\n", payload_len, payload_niov, nid, pid); conn = ksocknal_send_target (nid); if (conn == NULL) { lib_finalize (&ksocknal_lib, private, cookie); return (-1); } - + ltx = ksocknal_setup_hdr (nal, private, cookie, hdr, type); if (ltx == NULL) { ksocknal_put_conn (conn); lib_finalize (&ksocknal_lib, private, cookie); return (-1); } - + /* append the payload_iovs to the one pointing at the header */ LASSERT (ltx->ltx_tx.tx_niov == 1 && ltx->ltx_tx.tx_nkiov == 0); LASSERT (payload_niov <= PTL_MD_MAX_IOV); - - memcpy (ltx->ltx_tx.tx_iov + 1, payload_iov, + + memcpy (ltx->ltx_tx.tx_iov + 1, payload_iov, payload_niov * sizeof (*payload_iov)); ltx->ltx_tx.tx_niov = 1 + payload_niov; ltx->ltx_tx.tx_nob = sizeof (*hdr) + payload_len; - + ksocknal_launch_packet (conn, <x->ltx_tx); return (0); } diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 775d169..2409812 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -238,7 +238,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", @@ -275,7 +276,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"); @@ -296,7 +297,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) { @@ -432,8 +443,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 79964d2..342e955 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -19,7 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #define DEBUG_SUBSYSTEM S_PORTALS #include @@ -63,10 +65,9 @@ struct semaphore nal_cmd_sem; void kportal_assertion_failed(char *expr, char *file, const char *func, const int line) { - unsigned long stack = CDEBUG_STACK(stack); - portals_debug_msg(0, D_EMERG, file, func, line, stack, + portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif @@ -87,8 +88,8 @@ kportal_blockallsigs () unsigned long flags; SIGNAL_MASK_LOCK(current, flags); - siginitsetinv (¤t->blocked, 0); - RECALC_SIGPENDING(); + sigfillset(¤t->blocked); + RECALC_SIGPENDING; SIGNAL_MASK_UNLOCK(current, flags); } diff --git a/lnet/ulnds/Makefile.am b/lnet/ulnds/Makefile.am index b62b401..dc427b0 100644 --- a/lnet/ulnds/Makefile.am +++ b/lnet/ulnds/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h diff --git a/lnet/ulnds/socklnd/Makefile.am b/lnet/ulnds/socklnd/Makefile.am index b62b401..dc427b0 100644 --- a/lnet/ulnds/socklnd/Makefile.am +++ b/lnet/ulnds/socklnd/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h diff --git a/lustre/portals/Makefile.am b/lustre/portals/Makefile.am index 9c84d8e..1a223f2 100644 --- a/lustre/portals/Makefile.am +++ b/lustre/portals/Makefile.am @@ -3,8 +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 MCP -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/archdep.m4 b/lustre/portals/archdep.m4 index 3a433be..1b93d37 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -150,7 +150,7 @@ fi # ------------ include paths ------------------ if test $host_cpu != "lib" ; then - KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include -I$(LINUX)/include' + KINCFLAGS="-I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include -I$LINUX/include" else KINCFLAGS='-I$(top_srcdir)/include -I$(top_srcdir)/portals/include' fi @@ -303,4 +303,20 @@ AC_SUBST(MOD_LINK) AC_SUBST(LINUX25) AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) +# ---------- Red Hat 2.4.20 backports some 2.5 bits -------- +# This needs to run after we've defined the KCPPFLAGS +AC_MSG_CHECKING(for kernel version) +AC_TRY_LINK([#define __KERNEL__ + #include ], + [struct task_struct p; + p.sighand = NULL;], + [RH_2_4_20=1], + [RH_2_4_20=0]) + +if test $RH_2_4_20 = 1; then + AC_MSG_RESULT(redhat-2.4.20) + CPPFLAGS="$CPPFLAGS -DCONFIG_RH_2_4_20" +else + AC_MSG_RESULT($RELEASE) +fi diff --git a/lustre/portals/doc/ieee.bst b/lustre/portals/doc/ieee.bst index 5367caa..4df7c50 100644 --- a/lustre/portals/doc/ieee.bst +++ b/lustre/portals/doc/ieee.bst @@ -1,7 +1,5 @@ % --------------------------------------------------------------- % -% $Id: ieee.bst,v 1.1.2.1 2003/05/19 04:25:30 braam Exp $ -% % by Paolo.Ienne@di.epfl.ch % % --------------------------------------------------------------- diff --git a/lustre/portals/doc/portals3.lyx b/lustre/portals/doc/portals3.lyx index f3c24e0..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.2.1 $\hfil$Date: 2003/05/19 04:25:30 $}% -{$Date: 2003/05/19 04:25:30 $\hfil$Revision: 1.1.2.1 $} \end_preamble \language american \inputencoding auto diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index 64fdb1c..9a3e64a 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -83,45 +83,40 @@ extern unsigned int portal_printk; #ifdef __KERNEL__ # include /* THREAD_SIZE */ -#ifdef __arch_ia64__ -#define CDEBUG_STACK(var) (&var & (THREAD_SIZE - 1)) +#ifdef __ia64__ +#define CDEBUG_STACK() ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1)) #else -#define CDEBUG_STACK(var) (THREAD_SIZE - \ - ((unsigned long)__builtin_frame_address(0)& \ - (THREAD_SIZE - 1))) +#define CDEBUG_STACK() (THREAD_SIZE - \ + ((unsigned long)__builtin_frame_address(0) & \ + (THREAD_SIZE - 1))) #endif #define CHECK_STACK(stack) \ do { \ - if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) \ + if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \ portals_debug_msg(DEBUG_SUBSYSTEM, D_ERROR, \ __FILE__, __FUNCTION__, __LINE__, \ (stack), \ "maximum lustre stack %u\n", \ portal_stack = (stack)); \ + /*panic("LBUG");*/ \ + } \ } while (0) #else #define CHECK_STACK(stack) do{}while(0) #define CDEBUG_STACK(var) (0) #endif +#if 1 #define CDEBUG(mask, format, a...) \ do { \ - unsigned long stack = CDEBUG_STACK(stack); \ - int match = 0; \ - \ - CHECK_STACK(stack); \ - if (!(mask)) \ - match = 1; \ - else if ((mask) & (D_ERROR | D_EMERG)) \ - match = 1; \ - else if (portal_debug & (mask) && \ - portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24))) \ - match = 1; \ - if (match) \ + CHECK_STACK(CDEBUG_STACK()); \ + if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \ + (portal_debug & (mask) && \ + portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \ portals_debug_msg(DEBUG_SUBSYSTEM, mask, \ __FILE__, __FUNCTION__, __LINE__, \ - stack, format , ## a); \ + CDEBUG_STACK(), format , ## a); \ } while (0) #define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a) @@ -140,10 +135,8 @@ do { \ #define RETURN(rc) \ do { \ typeof(rc) RETURN__ret = (rc); \ - long tmp = (long)RETURN__ret; \ CDEBUG(D_TRACE, "Process leaving (rc=%lu : %ld : %lx)\n", \ - (unsigned long)tmp, (signed long)tmp, \ - (signed long)tmp); \ + (long)RETURN__ret, (long)RETURN__ret, (long)RETURN__ret);\ return RETURN__ret; \ } while (0) @@ -156,6 +149,16 @@ do { \ do { \ CDEBUG(D_TRACE, "Process leaving\n"); \ } while(0) +#else +#define CDEBUG(mask, format, a...) do { } while (0) +#define CWARN(format, a...) do { } while (0) +#define CERROR(format, a...) printk("<3>" format, ## a) +#define CEMERG(format, a...) printk("<0>" format, ## a) +#define GOTO(label, rc) do { (void)(rc); goto label; } while (0) +#define RETURN(rc) return (rc) +#define ENTRY do { } while (0) +#define EXIT do { } while (0) +#endif #ifdef __KERNEL__ @@ -214,24 +217,26 @@ extern void kportal_assertion_failed(char *expr, char *file, #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 285f7e0..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.2.1 2003/05/19 04:25:31 braam 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/list.h b/lustre/portals/include/portals/list.h index 41613ab..2b63312 100644 --- a/lustre/portals/include/portals/list.h +++ b/lustre/portals/include/portals/list.h @@ -233,14 +233,13 @@ static inline void list_splice_init(struct list_head *list, /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop counter. - * @n: the &struct list_head to use as temporary storage + * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_struct within the struct. */ -#define list_for_each_entry_safe(pos, n, head, member) \ +#define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ - n = pos->member.next; \ + n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ - pos = list_entry(n, typeof(*pos), member), \ - n = pos->member.next) + pos = n, n = list_entry(n->member.next, typeof(*n), member)) #endif diff --git a/lustre/portals/include/portals/myrnal.h b/lustre/portals/include/portals/myrnal.h index 6a61fd5..12b1925 100644 --- a/lustre/portals/include/portals/myrnal.h +++ b/lustre/portals/include/portals/myrnal.h @@ -1,5 +1,4 @@ /* -** $Id: myrnal.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ #ifndef MYRNAL_H diff --git a/lustre/portals/include/portals/nal.h b/lustre/portals/include/portals/nal.h index c1c50ed..88be63c 100644 --- a/lustre/portals/include/portals/nal.h +++ b/lustre/portals/include/portals/nal.h @@ -1,5 +1,4 @@ /* -** $Id: nal.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ #ifndef _NAL_H_ #define _NAL_H_ diff --git a/lustre/portals/include/portals/ppid.h b/lustre/portals/include/portals/ppid.h index 34e5dc5..4727599 100644 --- a/lustre/portals/include/portals/ppid.h +++ b/lustre/portals/include/portals/ppid.h @@ -1,5 +1,4 @@ /* - * TITLE(ppid_h, "@(#) $Id: ppid.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $"); */ #ifndef _INCppidh_ diff --git a/lustre/portals/include/portals/stringtab.h b/lustre/portals/include/portals/stringtab.h index 65ab189..c9683f7 100644 --- a/lustre/portals/include/portals/stringtab.h +++ b/lustre/portals/include/portals/stringtab.h @@ -1,5 +1,4 @@ /* -** $Id: stringtab.h,v 1.1.2.1 2003/05/19 04:25:31 braam Exp $ */ /* * stringtab.h diff --git a/lustre/portals/knals/Makefile.am b/lustre/portals/knals/Makefile.am index 5c6085e..fed2785 100644 --- a/lustre/portals/knals/Makefile.am +++ b/lustre/portals/knals/Makefile.am @@ -3,4 +3,5 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution +DIST_SUBDIRS= socknal toenal qswnal gmnal scimacnal SUBDIRS= socknal toenal @QSWNAL@ @GMNAL@ @SCIMACNAL@ diff --git a/lustre/portals/knals/socknal/socknal.h b/lustre/portals/knals/socknal/socknal.h index 5c6cfa7..be94bbb 100644 --- a/lustre/portals/knals/socknal/socknal.h +++ b/lustre/portals/knals/socknal/socknal.h @@ -273,9 +273,9 @@ extern void ksocknal_close_conn (ksock_conn_t *conn); static inline void ksocknal_put_conn (ksock_conn_t *conn) { - CDEBUG (D_OTHER, "putting conn[%p] -> "LPX64" (%d)\n", + CDEBUG (D_OTHER, "putting conn[%p] -> "LPX64" (%d)\n", conn, conn->ksnc_peernid, atomic_read (&conn->ksnc_refcount)); - + if (atomic_dec_and_test (&conn->ksnc_refcount)) _ksocknal_put_conn (conn); } diff --git a/lustre/portals/knals/socknal/socknal_cb.c b/lustre/portals/knals/socknal/socknal_cb.c index 153ac84..16ee04a 100644 --- a/lustre/portals/knals/socknal/socknal_cb.c +++ b/lustre/portals/knals/socknal/socknal_cb.c @@ -740,15 +740,16 @@ ksocknal_setup_hdr (nal_cb_t *nal, void *private, lib_msg_t *cookie, } int -ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, +ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, ptl_hdr_t *hdr, int type, ptl_nid_t nid, ptl_pid_t pid, - unsigned int payload_niov, struct iovec *payload_iov, size_t payload_len) + unsigned int payload_niov, struct iovec *payload_iov, + size_t payload_len) { ksock_ltx_t *ltx; ksock_conn_t *conn; - + /* NB 'private' is different depending on what we're sending. - * Just ignore it until we can rely on it + * Just ignore it until we can rely on it * * Also, the return code from this procedure is ignored. * If we can't send, we must still complete with lib_finalize(). @@ -756,31 +757,31 @@ ksocknal_send (nal_cb_t *nal, void *private, lib_msg_t *cookie, */ CDEBUG(D_NET, - "sending "LPSZ" bytes in %d mapped frags to nid: "LPX64" pid %d\n", - payload_len, payload_niov, nid, pid); + "sending "LPSZ" bytes in %d mapped frags to nid: "LPX64 + " pid %d\n", payload_len, payload_niov, nid, pid); conn = ksocknal_send_target (nid); if (conn == NULL) { lib_finalize (&ksocknal_lib, private, cookie); return (-1); } - + ltx = ksocknal_setup_hdr (nal, private, cookie, hdr, type); if (ltx == NULL) { ksocknal_put_conn (conn); lib_finalize (&ksocknal_lib, private, cookie); return (-1); } - + /* append the payload_iovs to the one pointing at the header */ LASSERT (ltx->ltx_tx.tx_niov == 1 && ltx->ltx_tx.tx_nkiov == 0); LASSERT (payload_niov <= PTL_MD_MAX_IOV); - - memcpy (ltx->ltx_tx.tx_iov + 1, payload_iov, + + memcpy (ltx->ltx_tx.tx_iov + 1, payload_iov, payload_niov * sizeof (*payload_iov)); ltx->ltx_tx.tx_niov = 1 + payload_niov; ltx->ltx_tx.tx_nob = sizeof (*hdr) + payload_len; - + ksocknal_launch_packet (conn, <x->ltx_tx); return (0); } diff --git a/lustre/portals/libcfs/debug.c b/lustre/portals/libcfs/debug.c index 775d169..2409812 100644 --- a/lustre/portals/libcfs/debug.c +++ b/lustre/portals/libcfs/debug.c @@ -238,7 +238,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", @@ -275,7 +276,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"); @@ -296,7 +297,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) { @@ -432,8 +443,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 79964d2..342e955 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -19,7 +19,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #define DEBUG_SUBSYSTEM S_PORTALS #include @@ -63,10 +65,9 @@ struct semaphore nal_cmd_sem; void kportal_assertion_failed(char *expr, char *file, const char *func, const int line) { - unsigned long stack = CDEBUG_STACK(stack); - portals_debug_msg(0, D_EMERG, file, func, line, stack, + portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(), "ASSERTION(%s) failed\n", expr); - LBUG(); + LBUG_WITH_LOC(file, func, line); } #endif @@ -87,8 +88,8 @@ kportal_blockallsigs () unsigned long flags; SIGNAL_MASK_LOCK(current, flags); - siginitsetinv (¤t->blocked, 0); - RECALC_SIGPENDING(); + sigfillset(¤t->blocked); + RECALC_SIGPENDING; SIGNAL_MASK_UNLOCK(current, flags); } diff --git a/lustre/portals/unals/Makefile.am b/lustre/portals/unals/Makefile.am index b62b401..dc427b0 100644 --- a/lustre/portals/unals/Makefile.am +++ b/lustre/portals/unals/Makefile.am @@ -1,5 +1,5 @@ CPPFLAGS= INCLUDES=-I$(top_srcdir)/portals/include -I$(top_srcdir)/include -I$(srcdir) lib_LIBRARIES = libtcpnal.a -pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h +pkginclude_HEADERS = pqtimer.h dispatch.h table.h timer.h connection.h ipmap.h bridge.h procbridge.h libtcpnal_a_SOURCES = debug.c pqtimer.c select.c table.c pqtimer.h dispatch.h table.h timer.h address.c procapi.c proclib.c connection.c tcpnal.c connection.h