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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161119161036.12679-10-nicstange@gmail.com>
Date:   Sat, 19 Nov 2016 17:10:29 +0100
From:   Nicolai Stange <nicstange@...il.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     John Stultz <john.stultz@...aro.org>, linux-kernel@...r.kernel.org,
        Nicolai Stange <nicstange@...il.com>
Subject: [RFC v8 21/28] clockevents: pack ->state_use_accessors and ->features together

Right now, the members ->state_use_accessors and ->features of
struct clock_event_device occupy an int each which is way more than needed:
the former can only take one of the five different values from
enum clock_event_state while the latter is a bitmask with the highest
CLOCK_EVT_FEAT_* bit defined so far being the ninth.

Both members are located in the first cacheline and thus, packing them into
a single int would free some precious space there.

Turn both members into appropriately sized bitfields.

Signed-off-by: Nicolai Stange <nicstange@...il.com>
---
 include/linux/clockchips.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index c8dfc7a..548f4fe 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -111,8 +111,8 @@ struct clock_event_device {
 	unsigned int		min_delta_ticks_adjusted;
 	u32			mult;
 	u32			shift;
-	enum clock_event_state	state_use_accessors;
-	unsigned int		features;
+	enum clock_event_state	state_use_accessors:8;
+	unsigned int		features:24;
 	unsigned long		retries;
 
 	int			(*set_state_periodic)(struct clock_event_device *);
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ