From 38bd9e1c0f361382b6aa517e4f2bf93f52cb4403 Mon Sep 17 00:00:00 2001 From: eeb Date: Sat, 26 Jul 2003 16:59:43 +0000 Subject: [PATCH] * Guarded #define EXPORT_SYMTAB * Bit the bullet and #defined PTL_MTU NB currently defined in ; maybe should move... --- lnet/include/lnet/lib-types.h | 4 +++- lnet/klnds/qswlnd/qswlnd.h | 11 ++++------- lnet/klnds/socklnd/socklnd.h | 10 ++++------ lnet/klnds/socklnd/socklnd_cb.c | 20 ++++++++------------ lnet/klnds/toelnd/toenal.h | 4 +++- lnet/libcfs/debug.c | 4 +++- lnet/libcfs/proc.c | 4 +++- lnet/router/router.h | 4 +++- lustre/ldlm/ldlm_lib.c | 4 +++- lustre/obdclass/obdo.c | 4 +++- lustre/obdclass/otree.c | 4 +++- lustre/obdclass/simple.c | 4 +++- lustre/osc/osc_lib.c | 4 +++- lustre/portals/include/portals/lib-types.h | 4 +++- lustre/portals/knals/qswnal/qswnal.h | 11 ++++------- lustre/portals/knals/socknal/socknal.h | 10 ++++------ lustre/portals/knals/socknal/socknal_cb.c | 20 ++++++++------------ lustre/portals/knals/toenal/toenal.h | 4 +++- lustre/portals/libcfs/debug.c | 4 +++- lustre/portals/libcfs/proc.c | 4 +++- lustre/portals/router/router.h | 4 +++- lustre/ptlrpc/ptlrpc_lib.c | 4 +++- 22 files changed, 80 insertions(+), 66 deletions(-) diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 47c0dd2..d300360b 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -138,8 +138,10 @@ typedef struct { /* temporary expedient: limit number of entries in discontiguous MDs */ #if PTL_LARGE_MTU -# define PTL_MD_MAX_IOV 64 +# define PTL_MTU (512<<10) +# define PTL_MD_MAX_IOV 128 #else +# define PTL_MTU (64<<10) # define PTL_MD_MAX_IOV 16 #endif diff --git a/lnet/klnds/qswlnd/qswlnd.h b/lnet/klnds/qswlnd/qswlnd.h index 85e585b..ef19ace 100644 --- a/lnet/klnds/qswlnd/qswlnd.h +++ b/lnet/klnds/qswlnd/qswlnd.h @@ -24,7 +24,9 @@ #ifndef _QSWNAL_H #define _QSWNAL_H -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #ifdef PROPRIETARY_ELAN # include @@ -93,12 +95,7 @@ typedef unsigned long kqsw_csum_t; * Performance Tuning defines * NB no mention of PAGE_SIZE for interoperability */ -#if PTL_LARGE_MTU -# define KQSW_MAXPAYLOAD (256<<10) /* biggest message this NAL will cope with */ -#else -# define KQSW_MAXPAYLOAD (64<<10) /* biggest message this NAL will cope with */ -#endif - +#define KQSW_MAXPAYLOAD PTL_MTU #define KQSW_SMALLPAYLOAD ((4<<10) - KQSW_HDR_SIZE) /* small/large ep receiver breakpoint */ #define KQSW_TX_MAXCONTIG (1<<10) /* largest payload that gets made contiguous on transmit */ diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h index 188d1f2..47ccd62 100644 --- a/lnet/klnds/socklnd/socklnd.h +++ b/lnet/klnds/socklnd/socklnd.h @@ -25,7 +25,9 @@ */ #define DEBUG_PORTAL_ALLOC -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include @@ -59,11 +61,7 @@ #define SOCKNAL_N_SCHED num_online_cpus() /* # socknal schedulers */ -#if PTL_LARGE_MTU -# define SOCKNAL_MAX_FWD_PAYLOAD (256<<10) /* biggest payload I can forward */ -#else -# define SOCKNAL_MAX_FWD_PAYLOAD (64<<10) /* biggest payload I can forward */ -#endif +#define SOCKNAL_MAX_FWD_PAYLOAD PTL_MTU /* biggest payload I can forward */ #define SOCKNAL_NLTXS 128 /* # normal transmit messages */ #define SOCKNAL_NNBLK_LTXS 128 /* # transmit messages reserved if can't block */ diff --git a/lnet/klnds/socklnd/socklnd_cb.c b/lnet/klnds/socklnd/socklnd_cb.c index ef74bc9..c9d805d 100644 --- a/lnet/klnds/socklnd/socklnd_cb.c +++ b/lnet/klnds/socklnd/socklnd_cb.c @@ -1375,22 +1375,18 @@ int ksocknal_scheduler (void *arg) int nloops = 0; int id = sched - ksocknal_data.ksnd_schedulers; char name[16]; -#if (CONFIG_SMP && CPU_AFFINITY) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - int cpu = cpu_logical_map(id % num_online_cpus()); -#else -#warning "Take care of architecure specific logical APIC map" - int cpu = 1; /* Have to change later. */ -#endif /* LINUX_VERSION_CODE */ - - set_cpus_allowed (current, 1 << cpu); - id = cpu; -#endif /* CONFIG_SMP && CPU_AFFINITY */ snprintf (name, sizeof (name),"ksocknald[%d]", id); kportal_daemonize (name); kportal_blockallsigs (); - + +#if (CONFIG_SMP && CPU_AFFINITY) + if ((cpu_online_map & (1 << id)) != 0) + current->cpus_allowed = (1 << id); + else + CERROR ("Can't set CPU affinity for %s\n", name); +#endif /* CONFIG_SMP && CPU_AFFINITY */ + spin_lock_irqsave (&sched->kss_lock, flags); while (!ksocknal_data.ksnd_shuttingdown) { diff --git a/lnet/klnds/toelnd/toenal.h b/lnet/klnds/toelnd/toenal.h index f793d3b..3654848 100644 --- a/lnet/klnds/toelnd/toenal.h +++ b/lnet/klnds/toelnd/toenal.h @@ -27,7 +27,9 @@ */ #define DEBUG_PORTAL_ALLOC -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 2606819..9d15c8f 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -20,7 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lnet/libcfs/proc.c b/lnet/libcfs/proc.c index 2fa739a..bb6c377 100644 --- a/lnet/libcfs/proc.c +++ b/lnet/libcfs/proc.c @@ -22,7 +22,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lnet/router/router.h b/lnet/router/router.h index b8c3bec..19159ab 100644 --- a/lnet/router/router.h +++ b/lnet/router/router.h @@ -23,7 +23,9 @@ #ifndef _KPTLROUTER_H #define _KPTLROUTER_H -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index e3f8673..55a00d2 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.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_LDLM #ifdef __KERNEL__ diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index 51f7156..f1d1b27 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -25,7 +25,9 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/obdclass/otree.c b/lustre/obdclass/otree.c index 16ef088..e35424d 100644 --- a/lustre/obdclass/otree.c +++ b/lustre/obdclass/otree.c @@ -24,7 +24,9 @@ * extent tree. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include #include diff --git a/lustre/obdclass/simple.c b/lustre/obdclass/simple.c index 1aceaeb..a285fb7 100644 --- a/lustre/obdclass/simple.c +++ b/lustre/obdclass/simple.c @@ -21,7 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/osc/osc_lib.c b/lustre/osc/osc_lib.c index db22668..e4219b0 100644 --- a/lustre/osc/osc_lib.c +++ b/lustre/osc/osc_lib.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_OSC #ifdef __KERNEL__ diff --git a/lustre/portals/include/portals/lib-types.h b/lustre/portals/include/portals/lib-types.h index 47c0dd2..d300360b 100644 --- a/lustre/portals/include/portals/lib-types.h +++ b/lustre/portals/include/portals/lib-types.h @@ -138,8 +138,10 @@ typedef struct { /* temporary expedient: limit number of entries in discontiguous MDs */ #if PTL_LARGE_MTU -# define PTL_MD_MAX_IOV 64 +# define PTL_MTU (512<<10) +# define PTL_MD_MAX_IOV 128 #else +# define PTL_MTU (64<<10) # define PTL_MD_MAX_IOV 16 #endif diff --git a/lustre/portals/knals/qswnal/qswnal.h b/lustre/portals/knals/qswnal/qswnal.h index 85e585b..ef19ace 100644 --- a/lustre/portals/knals/qswnal/qswnal.h +++ b/lustre/portals/knals/qswnal/qswnal.h @@ -24,7 +24,9 @@ #ifndef _QSWNAL_H #define _QSWNAL_H -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #ifdef PROPRIETARY_ELAN # include @@ -93,12 +95,7 @@ typedef unsigned long kqsw_csum_t; * Performance Tuning defines * NB no mention of PAGE_SIZE for interoperability */ -#if PTL_LARGE_MTU -# define KQSW_MAXPAYLOAD (256<<10) /* biggest message this NAL will cope with */ -#else -# define KQSW_MAXPAYLOAD (64<<10) /* biggest message this NAL will cope with */ -#endif - +#define KQSW_MAXPAYLOAD PTL_MTU #define KQSW_SMALLPAYLOAD ((4<<10) - KQSW_HDR_SIZE) /* small/large ep receiver breakpoint */ #define KQSW_TX_MAXCONTIG (1<<10) /* largest payload that gets made contiguous on transmit */ diff --git a/lustre/portals/knals/socknal/socknal.h b/lustre/portals/knals/socknal/socknal.h index 188d1f2..47ccd62 100644 --- a/lustre/portals/knals/socknal/socknal.h +++ b/lustre/portals/knals/socknal/socknal.h @@ -25,7 +25,9 @@ */ #define DEBUG_PORTAL_ALLOC -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include @@ -59,11 +61,7 @@ #define SOCKNAL_N_SCHED num_online_cpus() /* # socknal schedulers */ -#if PTL_LARGE_MTU -# define SOCKNAL_MAX_FWD_PAYLOAD (256<<10) /* biggest payload I can forward */ -#else -# define SOCKNAL_MAX_FWD_PAYLOAD (64<<10) /* biggest payload I can forward */ -#endif +#define SOCKNAL_MAX_FWD_PAYLOAD PTL_MTU /* biggest payload I can forward */ #define SOCKNAL_NLTXS 128 /* # normal transmit messages */ #define SOCKNAL_NNBLK_LTXS 128 /* # transmit messages reserved if can't block */ diff --git a/lustre/portals/knals/socknal/socknal_cb.c b/lustre/portals/knals/socknal/socknal_cb.c index ef74bc9..c9d805d 100644 --- a/lustre/portals/knals/socknal/socknal_cb.c +++ b/lustre/portals/knals/socknal/socknal_cb.c @@ -1375,22 +1375,18 @@ int ksocknal_scheduler (void *arg) int nloops = 0; int id = sched - ksocknal_data.ksnd_schedulers; char name[16]; -#if (CONFIG_SMP && CPU_AFFINITY) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - int cpu = cpu_logical_map(id % num_online_cpus()); -#else -#warning "Take care of architecure specific logical APIC map" - int cpu = 1; /* Have to change later. */ -#endif /* LINUX_VERSION_CODE */ - - set_cpus_allowed (current, 1 << cpu); - id = cpu; -#endif /* CONFIG_SMP && CPU_AFFINITY */ snprintf (name, sizeof (name),"ksocknald[%d]", id); kportal_daemonize (name); kportal_blockallsigs (); - + +#if (CONFIG_SMP && CPU_AFFINITY) + if ((cpu_online_map & (1 << id)) != 0) + current->cpus_allowed = (1 << id); + else + CERROR ("Can't set CPU affinity for %s\n", name); +#endif /* CONFIG_SMP && CPU_AFFINITY */ + spin_lock_irqsave (&sched->kss_lock, flags); while (!ksocknal_data.ksnd_shuttingdown) { diff --git a/lustre/portals/knals/toenal/toenal.h b/lustre/portals/knals/toenal/toenal.h index f793d3b..3654848 100644 --- a/lustre/portals/knals/toenal/toenal.h +++ b/lustre/portals/knals/toenal/toenal.h @@ -27,7 +27,9 @@ */ #define DEBUG_PORTAL_ALLOC -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/portals/libcfs/debug.c b/lustre/portals/libcfs/debug.c index 2606819..9d15c8f 100644 --- a/lustre/portals/libcfs/debug.c +++ b/lustre/portals/libcfs/debug.c @@ -20,7 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/portals/libcfs/proc.c b/lustre/portals/libcfs/proc.c index 2fa739a..bb6c377 100644 --- a/lustre/portals/libcfs/proc.c +++ b/lustre/portals/libcfs/proc.c @@ -22,7 +22,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/portals/router/router.h b/lustre/portals/router/router.h index b8c3bec..19159ab 100644 --- a/lustre/portals/router/router.h +++ b/lustre/portals/router/router.h @@ -23,7 +23,9 @@ #ifndef _KPTLROUTER_H #define _KPTLROUTER_H -#define EXPORT_SYMTAB +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif #include #include diff --git a/lustre/ptlrpc/ptlrpc_lib.c b/lustre/ptlrpc/ptlrpc_lib.c index 3dfec9a..f45f352 100644 --- a/lustre/ptlrpc/ptlrpc_lib.c +++ b/lustre/ptlrpc/ptlrpc_lib.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_RPC #ifdef __KERNEL__ -- 1.8.3.1