lkml.org 
[lkml]   [2016]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v8 21/28] clockevents: pack ->state_use_accessors and ->features together
Date
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@gmail.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
\
 
 \ /
  Last update: 2016-11-19 17:13    [W:0.216 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site