diff options
| -rw-r--r-- | arch/alpha/vmlinux.lds.in | 1 | ||||
| -rw-r--r-- | arch/arm/vmlinux-armo.lds.in | 1 | ||||
| -rw-r--r-- | arch/arm/vmlinux-armv.lds.in | 1 | ||||
| -rw-r--r-- | arch/cris/cris.ld | 1 | ||||
| -rw-r--r-- | arch/i386/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/ia64/vmlinux.lds.S | 1 | ||||
| -rw-r--r-- | arch/m68k/vmlinux-sun3.lds | 1 | ||||
| -rw-r--r-- | arch/m68k/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/mips64/ld.script.elf64 | 1 | ||||
| -rw-r--r-- | arch/parisc/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/ppc/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/ppc64/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/s390/vmlinux-shared.lds | 1 | ||||
| -rw-r--r-- | arch/s390/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/s390x/vmlinux-shared.lds | 1 | ||||
| -rw-r--r-- | arch/s390x/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/sh/vmlinux.lds.S | 2 | ||||
| -rw-r--r-- | arch/sparc/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/sparc64/vmlinux.lds | 1 | ||||
| -rw-r--r-- | arch/x86_64/vmlinux.lds | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 5 | ||||
| -rw-r--r-- | kernel/ksyms.c | 1 | ||||
| -rw-r--r-- | kernel/timer.c | 9 |
23 files changed, 34 insertions, 2 deletions
diff --git a/arch/alpha/vmlinux.lds.in b/arch/alpha/vmlinux.lds.in index c7dff2c79511..227aced15262 100644 --- a/arch/alpha/vmlinux.lds.in +++ b/arch/alpha/vmlinux.lds.in @@ -3,6 +3,7 @@ OUTPUT_FORMAT("elf64-alpha") ENTRY(__start) PHDRS { kernel PT_LOAD ; } +jiffies = jiffies_64; SECTIONS { #ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS diff --git a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in index c83777929ce5..2735a497b7f9 100644 --- a/arch/arm/vmlinux-armo.lds.in +++ b/arch/arm/vmlinux-armo.lds.in @@ -4,6 +4,7 @@ */ OUTPUT_ARCH(arm) ENTRY(stext) +jiffies = jiffies_64 + 4; SECTIONS { . = TEXTADDR; diff --git a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in index 618d9f28f153..c627bf30c0a6 100644 --- a/arch/arm/vmlinux-armv.lds.in +++ b/arch/arm/vmlinux-armv.lds.in @@ -4,6 +4,7 @@ */ OUTPUT_ARCH(arm) ENTRY(stext) +jiffies = jiffies_64 + 4; SECTIONS { . = TEXTADDR; diff --git a/arch/cris/cris.ld b/arch/cris/cris.ld index f62b467f6be5..edf1fa3f112c 100644 --- a/arch/cris/cris.ld +++ b/arch/cris/cris.ld @@ -8,6 +8,7 @@ * the kernel has booted. */ +jiffies = jiffies_64; SECTIONS { . = @CONFIG_ETRAX_DRAM_VIRTUAL_BASE@; diff --git a/arch/i386/vmlinux.lds b/arch/i386/vmlinux.lds index dd27a25e0f49..2980f1836c73 100644 --- a/arch/i386/vmlinux.lds +++ b/arch/i386/vmlinux.lds @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) +jiffies = jiffies_64; SECTIONS { . = 0xC0000000 + 0x100000; diff --git a/arch/ia64/vmlinux.lds.S b/arch/ia64/vmlinux.lds.S index 349ae209cff8..949da4b776e0 100644 --- a/arch/ia64/vmlinux.lds.S +++ b/arch/ia64/vmlinux.lds.S @@ -7,6 +7,7 @@ OUTPUT_FORMAT("elf64-ia64-little") OUTPUT_ARCH(ia64) ENTRY(phys_start) +jiffies = jiffies_64; SECTIONS { /* Sections to be discarded */ diff --git a/arch/m68k/vmlinux-sun3.lds b/arch/m68k/vmlinux-sun3.lds index 7894d47f43c9..339641da5167 100644 --- a/arch/m68k/vmlinux-sun3.lds +++ b/arch/m68k/vmlinux-sun3.lds @@ -2,6 +2,7 @@ OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_ARCH(m68k) ENTRY(_start) +jiffies = jiffies_64 + 4; SECTIONS { . = 0xE004000; diff --git a/arch/m68k/vmlinux.lds b/arch/m68k/vmlinux.lds index aea08a896651..c8348f4d22a0 100644 --- a/arch/m68k/vmlinux.lds +++ b/arch/m68k/vmlinux.lds @@ -2,6 +2,7 @@ OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_ARCH(m68k) ENTRY(_start) +jiffies = jiffies_64 + 4; SECTIONS { . = 0x1000; diff --git a/arch/mips64/ld.script.elf64 b/arch/mips64/ld.script.elf64 index 5b3554371831..16d1c0eeb045 100644 --- a/arch/mips64/ld.script.elf64 +++ b/arch/mips64/ld.script.elf64 @@ -1,5 +1,6 @@ OUTPUT_ARCH(mips) ENTRY(kernel_entry) +jiffies = jiffies_64; SECTIONS { /* Read-only sections, merged into text segment: */ diff --git a/arch/parisc/vmlinux.lds b/arch/parisc/vmlinux.lds index 77ed2059623a..4a2dc324620d 100644 --- a/arch/parisc/vmlinux.lds +++ b/arch/parisc/vmlinux.lds @@ -2,6 +2,7 @@ OUTPUT_FORMAT("elf32-hppa") OUTPUT_ARCH(hppa) ENTRY(_stext) +jiffies = jiffies_64 + 4; SECTIONS { diff --git a/arch/ppc/vmlinux.lds b/arch/ppc/vmlinux.lds index 531ba24f1912..26d576ec51c7 100644 --- a/arch/ppc/vmlinux.lds +++ b/arch/ppc/vmlinux.lds @@ -2,6 +2,7 @@ OUTPUT_ARCH(powerpc) SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); /* Do we need any of these for elf? __DYNAMIC = 0; */ +jiffies = jiffies_64 + 4; SECTIONS { /* Read-only sections, merged into text segment: */ diff --git a/arch/ppc64/vmlinux.lds b/arch/ppc64/vmlinux.lds index 18fed11ebb4b..f04db41f9609 100644 --- a/arch/ppc64/vmlinux.lds +++ b/arch/ppc64/vmlinux.lds @@ -2,6 +2,7 @@ OUTPUT_ARCH(powerpc) SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); /* Do we need any of these for elf? __DYNAMIC = 0; */ +jiffies = jiffies_64; SECTIONS { /* Read-only sections, merged into text segment: */ diff --git a/arch/s390/vmlinux-shared.lds b/arch/s390/vmlinux-shared.lds index ad325713d4a8..57e9666dcb32 100644 --- a/arch/s390/vmlinux-shared.lds +++ b/arch/s390/vmlinux-shared.lds @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") OUTPUT_ARCH(s390) ENTRY(_start) +jiffies = jiffies_64 + 4; SECTIONS { . = 0x00000000; diff --git a/arch/s390/vmlinux.lds b/arch/s390/vmlinux.lds index c1dd3aec050c..8dcaa3932a4d 100644 --- a/arch/s390/vmlinux.lds +++ b/arch/s390/vmlinux.lds @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") OUTPUT_ARCH(s390) ENTRY(_start) +jiffies = jiffies_64 + 4; SECTIONS { . = 0x00000000; diff --git a/arch/s390x/vmlinux-shared.lds b/arch/s390x/vmlinux-shared.lds index 1d22a5ec5aeb..3e68a6849530 100644 --- a/arch/s390x/vmlinux-shared.lds +++ b/arch/s390x/vmlinux-shared.lds @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") OUTPUT_ARCH(s390) ENTRY(_start) +jiffies = jiffies_64; SECTIONS { . = 0x00000000; diff --git a/arch/s390x/vmlinux.lds b/arch/s390x/vmlinux.lds index f3e7b069a5f3..5c52685afaf7 100644 --- a/arch/s390x/vmlinux.lds +++ b/arch/s390x/vmlinux.lds @@ -4,6 +4,7 @@ OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") OUTPUT_ARCH(s390) ENTRY(_start) +jiffies = jiffies_64; SECTIONS { . = 0x00000000; diff --git a/arch/sh/vmlinux.lds.S b/arch/sh/vmlinux.lds.S index 0620024f6d01..eebc61c626ba 100644 --- a/arch/sh/vmlinux.lds.S +++ b/arch/sh/vmlinux.lds.S @@ -5,8 +5,10 @@ #include <linux/config.h> #ifdef CONFIG_CPU_LITTLE_ENDIAN OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") +jiffies = jiffies_64; #else OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") +jiffies = jiffies_64 + 4; #endif OUTPUT_ARCH(sh) ENTRY(_start) diff --git a/arch/sparc/vmlinux.lds b/arch/sparc/vmlinux.lds index 380e189e7371..f02a3045400c 100644 --- a/arch/sparc/vmlinux.lds +++ b/arch/sparc/vmlinux.lds @@ -2,6 +2,7 @@ OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") OUTPUT_ARCH(sparc) ENTRY(_start) +jiffies = jiffies_64 + 4; SECTIONS { . = 0x10000 + SIZEOF_HEADERS; diff --git a/arch/sparc64/vmlinux.lds b/arch/sparc64/vmlinux.lds index 968ed2b08775..dd256448c7b2 100644 --- a/arch/sparc64/vmlinux.lds +++ b/arch/sparc64/vmlinux.lds @@ -3,6 +3,7 @@ OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") OUTPUT_ARCH(sparc:v9a) ENTRY(_start) +jiffies = jiffies_64; SECTIONS { swapper_pmd_dir = 0x0000000000402000; diff --git a/arch/x86_64/vmlinux.lds b/arch/x86_64/vmlinux.lds index e31563da6d18..02db953ba47a 100644 --- a/arch/x86_64/vmlinux.lds +++ b/arch/x86_64/vmlinux.lds @@ -3,6 +3,7 @@ */ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_ARCH(i386:x86-64) +jiffies = jiffies_64; ENTRY(_start) SECTIONS { diff --git a/include/linux/sched.h b/include/linux/sched.h index af396542c8ae..fdf83faccdde 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -459,6 +459,11 @@ extern void free_uid(struct user_struct *); #include <asm/current.h> +/* + * The 64-bit value is not volatile - you MUST NOT read it + * without holding read_lock_irq(&xtime_lock) + */ +extern u64 jiffies_64; extern unsigned long volatile jiffies; extern unsigned long itimer_ticks; extern unsigned long itimer_next; diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 7161915677b9..9001c829f4ef 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -471,6 +471,7 @@ EXPORT_SYMBOL_GPL(idle_cpu); EXPORT_SYMBOL_GPL(set_cpus_allowed); #endif EXPORT_SYMBOL(jiffies); +EXPORT_SYMBOL(jiffies_64); EXPORT_SYMBOL(xtime); EXPORT_SYMBOL(do_gettimeofday); EXPORT_SYMBOL(do_settimeofday); diff --git a/kernel/timer.c b/kernel/timer.c index 504af956c037..6fc0466711cc 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -67,7 +67,12 @@ unsigned long event; extern int do_setitimer(int, struct itimerval *, struct itimerval *); -unsigned long volatile jiffies; +/* + * The 64-bit value is not volatile - you MUST NOT read it + * without holding read_lock_irq(&xtime_lock). + * jiffies is defined in the linker script... + */ +u64 jiffies_64; unsigned int * prof_buffer; unsigned long prof_len; @@ -664,7 +669,7 @@ void timer_bh(void) void do_timer(struct pt_regs *regs) { - (*(unsigned long *)&jiffies)++; + jiffies_64++; #ifndef CONFIG_SMP /* SMP process accounting uses the local APIC timer */ |
