History

[SPARC64]: Add __read_mostly support.

David S. Miller committed 21 years ago

Commit d369ddd1 parent 9126dfd4 files · +17 −21Browse files

Unified · Split

4 files
  1. arch/sparc64/kernel/smp.c +5 −5
  2. arch/sparc64/kernel/time.c +9 −15
  3. arch/sparc64/kernel/vmlinux.lds.S +2 −0
  4. include/linux/cache.h +1 −1
arch/sparc64/kernel/smp.c+5−5
@@ -45,8 +45,8 @@ extern void calibrate_delay(void); · 44 unmodified lines
4545 /* Please don't make this stuff initdata!!! --DaveM */
4646 static unsigned char boot_cpu_id;
4747
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;
5050 static cpumask_t smp_commenced_mask;
5151 static cpumask_t cpu_callout_map;
5252
@@ -155,7 +155,7 @@ void cpu_panic(void) · 102 unmodified lines
155155 panic("SMP bolixed\n");
156156 }
157157
158−static unsigned long current_tick_offset;
158+static unsigned long current_tick_offset __read_mostly;
159159
160160 /* This tick register synchronization scheme is taken entirely from
161161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
@@ -1193,8 +1193,8 @@ void smp_send_stop(void) · 1031 unmodified lines
11931193 {
11941194 }
11951195
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;
11981198
11991199 EXPORT_SYMBOL(__per_cpu_base);
12001200 EXPORT_SYMBOL(__per_cpu_shift);
arch/sparc64/kernel/time.c+9−15
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = { · 72 unmodified lines
7373 .get_tick = dummy_get_tick,
7474 };
7575
76−struct sparc64_tick_ops *tick_ops = &dummy_tick_ops;
76+struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops;
7777
7878 #define TICK_PRIV_BIT (1UL << 63)
7979
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset) · 115 unmodified lines
195195 return new_tick;
196196 }
197197
198−static struct sparc64_tick_ops tick_operations = {
198+static struct sparc64_tick_ops tick_operations __read_mostly = {
199199 .init_tick = tick_init_tick,
200200 .get_tick = tick_get_tick,
201201 .get_compare = tick_get_compare,
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj) · 74 unmodified lines
276276 return new_compare;
277277 }
278278
279−static struct sparc64_tick_ops stick_operations = {
279+static struct sparc64_tick_ops stick_operations __read_mostly = {
280280 .init_tick = stick_init_tick,
281281 .get_tick = stick_get_tick,
282282 .get_compare = stick_get_compare,
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj) · 139 unmodified lines
422422 return val;
423423 }
424424
425−static struct sparc64_tick_ops hbtick_operations = {
425+static struct sparc64_tick_ops hbtick_operations __read_mostly = {
426426 .init_tick = hbtick_init_tick,
427427 .get_tick = hbtick_get_tick,
428428 .get_compare = hbtick_get_compare,
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = { · 8 unmodified lines
437437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2
438438 * interrupts, one at level14 and one with softint bit 0.
439439 */
440−unsigned long timer_tick_offset;
441−unsigned long timer_tick_compare;
440+unsigned long timer_tick_offset __read_mostly;
442441
443−static unsigned long timer_ticks_per_nsec_quotient;
442+static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
444443
445444 #define TICK_SIZE (tick_nsec / 1000)
446445
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void) · 17 unmodified lines
464463
465464 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
466465 {
467− unsigned long ticks, pstate;
466+ unsigned long ticks, compare, pstate;
468467
469468 write_seqlock(&xtime_lock);
470469
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) · 12 unmodified lines
483482 : "=r" (pstate)
484483 : "i" (PSTATE_IE));
485484
486− timer_tick_compare = tick_ops->add_compare(timer_tick_offset);
485+ compare = tick_ops->add_compare(timer_tick_offset);
487486 ticks = tick_ops->get_tick();
488487
489488 /* Restore PSTATE_IE. */
490489 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
491490 : /* no outputs */
492491 : "r" (pstate));
493− } while (time_after_eq(ticks, timer_tick_compare));
492+ } while (time_after_eq(ticks, compare));
494493
495494 timer_check_rtc();
496495
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs) · 9 unmodified lines
506505
507506 do_timer(regs);
508507
509− /*
510− * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR.
511− */
512− timer_tick_compare = tick_ops->get_compare() + timer_tick_offset;
513−
514508 timer_check_rtc();
515509
516510 write_sequnlock(&xtime_lock);
arch/sparc64/kernel/vmlinux.lds.S+2−0
@@ -32,6 +32,8 @@ SECTIONS · 31 unmodified lines
3232 .data1 : { *(.data1) }
3333 . = ALIGN(64);
3434 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
35+ . = ALIGN(64);
36+ .data.read_mostly : { *(.data.read_mostly) }
3537 _edata = .;
3638 PROVIDE (edata = .);
3739 .fixup : { *(.fixup) }
include/linux/cache.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #define SMP_CACHE_BYTES L1_CACHE_BYTES
1414 #endif
1515
16−#ifdef CONFIG_X86
16+#if defined(CONFIG_X86) || defined(CONFIG_SPARC64)
1717 #define __read_mostly __attribute__((__section__(".data.read_mostly")))
1818 #else
1919 #define __read_mostly