Skip to content

Commit 7c30f35

Browse files
Matthias Kaehlcketorvalds
authored andcommitted
jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp
jiffies_64 is defined in kernel/time/timer.c with ____cacheline_aligned_in_smp, however this macro is not part of the declaration of jiffies and jiffies_64 in jiffies.h. As a result clang generates the following warning: kernel/time/timer.c:57:26: error: section does not match previous declaration [-Werror,-Wsection] __visible u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; ^ include/linux/cache.h:39:36: note: expanded from macro '__cacheline_aligned_in_smp' ^ include/linux/cache.h:34:4: note: expanded from macro '__cacheline_aligned' __section__(".data..cacheline_aligned"))) ^ include/linux/jiffies.h:77:12: note: previous attribute is here extern u64 __jiffy_data jiffies_64; ^ include/linux/jiffies.h:70:38: note: expanded from macro '__jiffy_data' Link: http://lkml.kernel.org/r/20170403190200.70273-1-mka@chromium.org Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Cc: "Jason A . Donenfeld" <Jason@zx2c4.com> Cc: Grant Grundler <grundler@chromium.org> Cc: Michael Davidson <md@google.com> Cc: Greg Hackmann <ghackmann@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3d88936 commit 7c30f35

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

include/linux/jiffies.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _LINUX_JIFFIES_H
22
#define _LINUX_JIFFIES_H
33

4+
#include <linux/cache.h>
45
#include <linux/math64.h>
56
#include <linux/kernel.h>
67
#include <linux/types.h>
@@ -63,19 +64,13 @@ extern int register_refined_jiffies(long clock_tick_rate);
6364
/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
6465
#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
6566

66-
/* some arch's have a small-data section that can be accessed register-relative
67-
* but that can only take up to, say, 4-byte variables. jiffies being part of
68-
* an 8-byte variable may not be correctly accessed unless we force the issue
69-
*/
70-
#define __jiffy_data __attribute__((section(".data")))
71-
7267
/*
7368
* The 64-bit value is not atomic - you MUST NOT read it
7469
* without sampling the sequence number in jiffies_lock.
7570
* get_jiffies_64() will do this for you as appropriate.
7671
*/
77-
extern u64 __jiffy_data jiffies_64;
78-
extern unsigned long volatile __jiffy_data jiffies;
72+
extern u64 __cacheline_aligned_in_smp jiffies_64;
73+
extern unsigned long volatile __cacheline_aligned_in_smp jiffies;
7974

8075
#if (BITS_PER_LONG < 64)
8176
u64 get_jiffies_64(void);

0 commit comments

Comments
 (0)