From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: LAK <linux-arm-kernel@lists.infradead.org>,
Ingo Molnar <mingo@elte.hu>, John Stultz <john.stultz@linaro.org>
Subject: [patch 1/7] clocksource: Restructure clocksource struct members
Date: Wed, 18 May 2011 21:33:40 -0000 [thread overview]
Message-ID: <20110518210136.003081882@linutronix.de> (raw)
In-Reply-To: <20110518205713.947614271@linutronix.de>
[-- Attachment #1: clocksource-better-layout.patch --]
[-- Type: text/plain, Size: 2119 bytes --]
Group the hot path members of struct clocksource together so we have a
better cache line footprint. Make it cacheline aligned.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Eric Dumazet <eric.dumazet@gmail.com>
---
include/linux/clocksource.h | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
Index: linux-2.6-tip/include/linux/clocksource.h
===================================================================
--- linux-2.6-tip.orig/include/linux/clocksource.h
+++ linux-2.6-tip/include/linux/clocksource.h
@@ -159,42 +159,38 @@ extern u64 timecounter_cyc2time(struct t
*/
struct clocksource {
/*
- * First part of structure is read mostly
+ * Hotpath data, fits in a single cache line when the
+ * clocksource itself is cacheline aligned.
*/
- const char *name;
- struct list_head list;
- int rating;
cycle_t (*read)(struct clocksource *cs);
- int (*enable)(struct clocksource *cs);
- void (*disable)(struct clocksource *cs);
+ cycle_t cycle_last;
cycle_t mask;
u32 mult;
u32 shift;
u64 max_idle_ns;
- unsigned long flags;
- cycle_t (*vread)(void);
- void (*suspend)(struct clocksource *cs);
- void (*resume)(struct clocksource *cs);
+
#ifdef CONFIG_IA64
void *fsys_mmio; /* used by fsyscall asm code */
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
#else
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
#endif
-
- /*
- * Second part is written at each timer interrupt
- * Keep it in a different cache line to dirty no
- * more than one cache line.
- */
- cycle_t cycle_last ____cacheline_aligned_in_smp;
+ const char *name;
+ struct list_head list;
+ int rating;
+ cycle_t (*vread)(void);
+ int (*enable)(struct clocksource *cs);
+ void (*disable)(struct clocksource *cs);
+ unsigned long flags;
+ void (*suspend)(struct clocksource *cs);
+ void (*resume)(struct clocksource *cs);
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
/* Watchdog related data, used by the framework */
struct list_head wd_list;
cycle_t wd_last;
#endif
-};
+} ____cacheline_aligned;
/*
* Clock source flags bits::
next prev parent reply other threads:[~2011-05-18 21:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 21:33 [patch 0/7] clocksources/clockevents improvements Thomas Gleixner
2011-05-18 21:33 ` Thomas Gleixner [this message]
2011-05-18 21:33 ` [patch 2/7] clocksource: Get rid of the hardcoded 5 seconds sleep time limit Thomas Gleixner
2011-05-19 0:57 ` John Stultz
2011-05-19 8:43 ` Thomas Gleixner
2011-05-20 1:10 ` john stultz
2011-05-18 21:33 ` [patch 4/7] clockevents: Provide combined configure and register function Thomas Gleixner
2011-05-19 9:08 ` Ingo Molnar
2011-05-19 10:00 ` Thomas Gleixner
2011-05-19 18:10 ` Ingo Molnar
2011-05-18 21:33 ` [patch 3/7] clockevents: Restructure clock_event_device members Thomas Gleixner
2011-05-18 21:33 ` [patch 6/7] x86: Convert PIT to clockevents_config_and_register() Thomas Gleixner
2011-05-18 21:33 ` [patch 5/7] clockevents: Provide interface to reconfigure an active clock event device Thomas Gleixner
2011-05-19 7:26 ` Linus Walleij
2011-05-19 9:10 ` Ingo Molnar
2011-05-19 9:33 ` Thomas Gleixner
2011-05-19 9:37 ` Ingo Molnar
2011-05-18 21:33 ` [patch 7/7] x86: hpet: Cleanup the clockevents init and register code Thomas Gleixner
2011-05-19 9:33 ` Ingo Molnar
2011-05-19 9:34 ` [patch 0/7] clocksources/clockevents improvements Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110518210136.003081882@linutronix.de \
--to=tglx@linutronix.de \
--cc=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®