--- linux.org/arch/i386/kernel/i386_ksyms.c Mon Jul 16 13:01:59 2001 +++ linux/arch/i386/kernel/i386_ksyms.c Thu Jul 26 16:43:34 2001 @@ -123,7 +123,7 @@ #ifdef CONFIG_SMP EXPORT_SYMBOL(cpu_data); -EXPORT_SYMBOL(kernel_flag); +EXPORT_SYMBOL(kernel_flag_cacheline); EXPORT_SYMBOL(smp_num_cpus); EXPORT_SYMBOL(cpu_online_map); EXPORT_SYMBOL_NOVERS(__write_lock_failed); --- linux.org/arch/i386/kernel/smp.c Mon Jul 16 13:01:59 2001 +++ linux/arch/i386/kernel/smp.c Thu Jul 26 17:50:09 2001 @@ -104,7 +104,10 @@ */ /* The 'big kernel lock' */ -spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; +spinlock_cacheline_t kernel_flag_cacheline = {SPIN_LOCK_UNLOCKED}; +#ifndef kernel_flag + #define kernel_flag kernel_flag_cacheline.lock +#endif struct tlb_state cpu_tlbstate[NR_CPUS] = {[0 ... NR_CPUS-1] = { &init_mm, 0 }}; --- linux.org/fs/buffer.c Mon Jul 16 13:01:42 2001 +++ linux/fs/buffer.c Thu Jul 26 16:23:53 2001 @@ -80,7 +80,12 @@ static rwlock_t hash_table_lock = RW_LOCK_UNLOCKED; static struct buffer_head *lru_list[NR_LIST]; -static spinlock_t lru_list_lock = SPIN_LOCK_UNLOCKED; + +static spinlock_cacheline_t lru_list_lock_cacheline = {SPIN_LOCK_UNLOCKED}; +#ifndef lru_list_lock + #define lru_list_lock lru_list_lock_cacheline.lock +#endif + static int nr_buffers_type[NR_LIST]; static unsigned long size_buffers_type[NR_LIST]; --- linux.org/include/asm-i386/smplock.h Tue Jul 17 09:36:15 2001 +++ linux/include/asm-i386/smplock.h Fri Jul 27 08:17:29 2001 @@ -8,7 +8,9 @@ #include #include -extern spinlock_t kernel_flag; + +extern spinlock_cacheline_t kernel_flag_cacheline; +#define kernel_flag kernel_flag_cacheline.lock #define kernel_locked() spin_is_locked(&kernel_flag) --- linux.org/include/asm-i386/spinlock.h Tue Jul 17 09:36:15 2001 +++ linux/include/asm-i386/spinlock.h Fri Jul 27 08:17:29 2001 @@ -25,6 +25,13 @@ #endif } spinlock_t; + +#include +typedef union { + spinlock_t lock; + char fill_up[(L1_CACHE_BYTES)]; +} spinlock_cacheline_t __attribute__ ((aligned(L1_CACHE_BYTES))); + #define SPINLOCK_MAGIC 0xdead4ead #if SPINLOCK_DEBUG --- linux.org/include/linux/autoconf.h Tue Jul 17 09:57:18 2001 +++ linux/include/linux/autoconf.h Fri Jul 27 08:15:38 2001 @@ -51,20 +51,22 @@ #undef CONFIG_MICROCODE #undef CONFIG_X86_MSR #undef CONFIG_X86_CPUID -#define CONFIG_NOHIGHMEM 1 -#undef CONFIG_HIGHMEM4G +#undef CONFIG_NOHIGHMEM +#define CONFIG_HIGHMEM4G 1 #undef CONFIG_HIGHMEM64G +#define CONFIG_HIGHMEM 1 #undef CONFIG_MATH_EMULATION #undef CONFIG_MTRR -#define CONFIG_SMP 1 -#define CONFIG_HAVE_DEC_LOCK 1 +#undef CONFIG_SMP +#define CONFIG_X86_UP_IOAPIC 1 +#define CONFIG_X86_IO_APIC 1 +#define CONFIG_X86_LOCAL_APIC 1 +#undef CONFIG_UP_NMI_WATCHDOG /* * General setup */ #define CONFIG_NET 1 #undef CONFIG_VISWS -#define CONFIG_X86_IO_APIC 1 -#define CONFIG_X86_LOCAL_APIC 1 #define CONFIG_PCI 1 #undef CONFIG_PCI_GOBIOS #undef CONFIG_PCI_GODIRECT --- linux.org/include/linux/spinlock.h Tue Jul 17 09:36:15 2001 +++ linux/include/linux/spinlock.h Fri Jul 27 08:17:29 2001 @@ -52,6 +52,7 @@ #define SPIN_LOCK_UNLOCKED (spinlock_t) { } #else typedef struct { int gcc_is_buggy; } spinlock_t; + typedef union { spinlock_t lock; } spinlock_cacheline_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } #endif --- linux.org/include/linux/swap.h Tue Jul 17 09:36:22 2001 +++ linux/include/linux/swap.h Fri Jul 27 08:17:34 2001 @@ -73,7 +73,9 @@ extern struct address_space swapper_space; extern atomic_t page_cache_size; extern atomic_t buffermem_pages; -extern spinlock_t pagecache_lock; + +extern spinlock_cacheline_t pagecache_lock_cacheline; +#define pagecache_lock (pagecache_lock_cacheline.lock) extern void __remove_inode_page(struct page *); /* Incomplete types for prototype declarations: */ @@ -165,7 +167,8 @@ extern unsigned long swap_cache_find_success; #endif -extern spinlock_t pagemap_lru_lock; +extern spinlock_cacheline_t pagemap_lru_lock_cacheline; +#define pagemap_lru_lock pagemap_lru_lock_cacheline.lock /* * Page aging defines. --- linux.org/mm/filemap.c Mon Jul 16 13:01:45 2001 +++ linux/mm/filemap.c Thu Jul 26 17:52:17 2001 @@ -45,12 +45,18 @@ unsigned int page_hash_bits; struct page **page_hash_table; -spinlock_t pagecache_lock = SPIN_LOCK_UNLOCKED; +spinlock_cacheline_t pagecache_lock_cacheline = {SPIN_LOCK_UNLOCKED}; +#ifndef pagecache_lock + #define pagecache_lock pagecache_lock_cacheline.lock +#endif /* * NOTE: to avoid deadlocking you must never acquire the pagecache_lock with * the pagemap_lru_lock held. */ -spinlock_t pagemap_lru_lock = SPIN_LOCK_UNLOCKED; +spinlock_cacheline_t pagemap_lru_lock_cacheline = {SPIN_LOCK_UNLOCKED}; +#ifndef pagemap_lru_lock + #define pagemap_lru_lock pagemap_lru_lock_cacheline.lock +#endif #define CLUSTER_PAGES (1 << page_cluster) #define CLUSTER_OFFSET(x) (((x) >> page_cluster) << page_cluster) --- linux.org/mm/highmem.c Mon Jul 16 13:01:45 2001 +++ linux/mm/highmem.c Thu Jul 26 16:22:19 2001 @@ -32,7 +32,11 @@ */ static int pkmap_count[LAST_PKMAP]; static unsigned int last_pkmap_nr; -static spinlock_t kmap_lock = SPIN_LOCK_UNLOCKED; + +static spinlock_cacheline_t kmap_lock_cacheline = {SPIN_LOCK_UNLOCKED}; +#ifndef kmap_lock + #define kmap_lock kmap_lock_cacheline.lock +#endif pte_t * pkmap_page_table;