Skip to content

Commit 97a5a90

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
vdso: Move architecture related data before basetime data
Architecture related vdso data is required in the fast path when reading CLOCK_MONOTONIC or CLOCK_REALTIME. At the moment, this information is located at the end of the vdso_time_data structure, which is a suboptimal cache layout. Move the architecture specific VDSO data right before the basetime information, which is always required. This change does not have an impact on architectures with CONFIG_ARCH_HAS_VDSO_DATA=n. Architectures, which have it enabled, gain a better cache layout. Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent ed0c10f commit 97a5a90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/vdso/datapage.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ struct vdso_timestamp {
7070

7171
/**
7272
* struct vdso_time_data - vdso datapage representation
73+
* @arch_data: architecture specific data (optional, defaults
74+
* to an empty struct)
7375
* @seq: timebase sequence counter
7476
* @clock_mode: clock mode
7577
* @cycle_last: timebase at clocksource init
@@ -83,8 +85,6 @@ struct vdso_timestamp {
8385
* @tz_dsttime: type of DST correction
8486
* @hrtimer_res: hrtimer resolution
8587
* @__unused: unused
86-
* @arch_data: architecture specific data (optional, defaults
87-
* to an empty struct)
8888
*
8989
* vdso_time_data will be accessed by 64 bit and compat code at the same time
9090
* so we should be careful before modifying this structure.
@@ -105,6 +105,8 @@ struct vdso_timestamp {
105105
* offset must be zero.
106106
*/
107107
struct vdso_time_data {
108+
struct arch_vdso_time_data arch_data;
109+
108110
u32 seq;
109111

110112
s32 clock_mode;
@@ -125,8 +127,6 @@ struct vdso_time_data {
125127
s32 tz_dsttime;
126128
u32 hrtimer_res;
127129
u32 __unused;
128-
129-
struct arch_vdso_time_data arch_data;
130130
} ____cacheline_aligned;
131131

132132
#define vdso_clock vdso_time_data

0 commit comments

Comments
 (0)