lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 25 Nov 2015 13:33:44 -0800
From:	tip-bot for Thomas Gleixner <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	viresh.kumar@...aro.org, sebastian_frias@...madesigns.com,
	mingo@...nel.org, hpa@...or.com, nico@...aro.org,
	linux-kernel@...r.kernel.org, mans@...sr.com, tony@...mide.com,
	tglx@...utronix.de, daniel.lezcano@...aro.org,
	linux@....linux.org.uk, marc_gonzalez@...madesigns.com,
	john.stultz@...aro.org
Subject: [tip:timers/core] timekeeping:
  Lift clocksource cacheline restriction

Commit-ID:  09a9982016499daeb3fbee5ac8d87797310a565a
Gitweb:     http://git.kernel.org/tip/09a9982016499daeb3fbee5ac8d87797310a565a
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Thu, 19 Nov 2015 11:43:09 +0100
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 25 Nov 2015 22:28:30 +0100

timekeeping: Lift clocksource cacheline restriction

We cache all hotpath members of a clocksource in the time keeper
core. So there is no requirement in general to cache line align struct
clocksource. Remove the enforces alignment.

That allows users which need to wrap struct clocksource into their own
struct to align the struct without getting extra padding.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: Marc Gonzalez <marc_gonzalez@...madesigns.com>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: Mans Rullgard <mans@...sr.com>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Nicolas Pitre <nico@...aro.org>
Cc: Tony Lindgren <tony@...mide.com>
Cc: Sebastian Frias <sebastian_frias@...madesigns.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1511191209000.3898@nanos
---
 include/linux/clocksource.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 7784b59..6013021 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -62,12 +62,18 @@ struct module;
  * @suspend:		suspend function for the clocksource, if necessary
  * @resume:		resume function for the clocksource, if necessary
  * @owner:		module reference, must be set by clocksource in modules
+ *
+ * Note: This struct is not used in hotpathes of the timekeeping code
+ * because the timekeeper caches the hot path fields in its own data
+ * structure, so no line cache alignment is required,
+ *
+ * The pointer to the clocksource itself is handed to the read
+ * callback. If you need extra information there you can wrap struct
+ * clocksource into your own struct. Depending on the amount of
+ * information you need you should consider to cache line align that
+ * structure.
  */
 struct clocksource {
-	/*
-	 * Hotpath data, fits in a single cache line when the
-	 * clocksource itself is cacheline aligned.
-	 */
 	cycle_t (*read)(struct clocksource *cs);
 	cycle_t mask;
 	u32 mult;
@@ -95,7 +101,7 @@ struct clocksource {
 	cycle_t wd_last;
 #endif
 	struct module *owner;
-} ____cacheline_aligned;
+};
 
 /*
  * Clock source flags bits::
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ