Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SPARC64]: Add __read_mostly support.

Signed-off-by: David S. Miller <davem@davemloft.net>

+17 -21
+5 -5
arch/sparc64/kernel/smp.c
··· 45 45 /* Please don't make this stuff initdata!!! --DaveM */ 46 46 static unsigned char boot_cpu_id; 47 47 48 - cpumask_t cpu_online_map = CPU_MASK_NONE; 49 - cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 48 + cpumask_t cpu_online_map = CPU_MASK_NONE __read_mostly; 49 + cpumask_t phys_cpu_present_map = CPU_MASK_NONE __read_mostly; 50 50 static cpumask_t smp_commenced_mask; 51 51 static cpumask_t cpu_callout_map; 52 52 ··· 155 155 panic("SMP bolixed\n"); 156 156 } 157 157 158 - static unsigned long current_tick_offset; 158 + static unsigned long current_tick_offset __read_mostly; 159 159 160 160 /* This tick register synchronization scheme is taken entirely from 161 161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit. ··· 1193 1193 { 1194 1194 } 1195 1195 1196 - unsigned long __per_cpu_base; 1197 - unsigned long __per_cpu_shift; 1196 + unsigned long __per_cpu_base __read_mostly; 1197 + unsigned long __per_cpu_shift __read_mostly; 1198 1198 1199 1199 EXPORT_SYMBOL(__per_cpu_base); 1200 1200 EXPORT_SYMBOL(__per_cpu_shift);
+9 -15
arch/sparc64/kernel/time.c
··· 73 73 .get_tick = dummy_get_tick, 74 74 }; 75 75 76 - struct sparc64_tick_ops *tick_ops = &dummy_tick_ops; 76 + struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops; 77 77 78 78 #define TICK_PRIV_BIT (1UL << 63) 79 79 ··· 195 195 return new_tick; 196 196 } 197 197 198 - static struct sparc64_tick_ops tick_operations = { 198 + static struct sparc64_tick_ops tick_operations __read_mostly = { 199 199 .init_tick = tick_init_tick, 200 200 .get_tick = tick_get_tick, 201 201 .get_compare = tick_get_compare, ··· 276 276 return new_compare; 277 277 } 278 278 279 - static struct sparc64_tick_ops stick_operations = { 279 + static struct sparc64_tick_ops stick_operations __read_mostly = { 280 280 .init_tick = stick_init_tick, 281 281 .get_tick = stick_get_tick, 282 282 .get_compare = stick_get_compare, ··· 422 422 return val; 423 423 } 424 424 425 - static struct sparc64_tick_ops hbtick_operations = { 425 + static struct sparc64_tick_ops hbtick_operations __read_mostly = { 426 426 .init_tick = hbtick_init_tick, 427 427 .get_tick = hbtick_get_tick, 428 428 .get_compare = hbtick_get_compare, ··· 437 437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2 438 438 * interrupts, one at level14 and one with softint bit 0. 439 439 */ 440 - unsigned long timer_tick_offset; 441 - unsigned long timer_tick_compare; 440 + unsigned long timer_tick_offset __read_mostly; 442 441 443 - static unsigned long timer_ticks_per_nsec_quotient; 442 + static unsigned long timer_ticks_per_nsec_quotient __read_mostly; 444 443 445 444 #define TICK_SIZE (tick_nsec / 1000) 446 445 ··· 463 464 464 465 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) 465 466 { 466 - unsigned long ticks, pstate; 467 + unsigned long ticks, compare, pstate; 467 468 468 469 write_seqlock(&xtime_lock); 469 470 ··· 482 483 : "=r" (pstate) 483 484 : "i" (PSTATE_IE)); 484 485 485 - timer_tick_compare = tick_ops->add_compare(timer_tick_offset); 486 + compare = tick_ops->add_compare(timer_tick_offset); 486 487 ticks = tick_ops->get_tick(); 487 488 488 489 /* Restore PSTATE_IE. */ 489 490 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 490 491 : /* no outputs */ 491 492 : "r" (pstate)); 492 - } while (time_after_eq(ticks, timer_tick_compare)); 493 + } while (time_after_eq(ticks, compare)); 493 494 494 495 timer_check_rtc(); 495 496 ··· 504 505 write_seqlock(&xtime_lock); 505 506 506 507 do_timer(regs); 507 - 508 - /* 509 - * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR. 510 - */ 511 - timer_tick_compare = tick_ops->get_compare() + timer_tick_offset; 512 508 513 509 timer_check_rtc(); 514 510
+2
arch/sparc64/kernel/vmlinux.lds.S
··· 32 32 .data1 : { *(.data1) } 33 33 . = ALIGN(64); 34 34 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 35 + . = ALIGN(64); 36 + .data.read_mostly : { *(.data.read_mostly) } 35 37 _edata = .; 36 38 PROVIDE (edata = .); 37 39 .fixup : { *(.fixup) }
+1 -1
include/linux/cache.h
··· 13 13 #define SMP_CACHE_BYTES L1_CACHE_BYTES 14 14 #endif 15 15 16 - #ifdef CONFIG_X86 16 + #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) 17 17 #define __read_mostly __attribute__((__section__(".data.read_mostly"))) 18 18 #else 19 19 #define __read_mostly