Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/vdso: Move VCLOCK_TIMENS to vdso_clock_modes

Move the time namespace indicator clock mode to the other ones for
consistency sake.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.656097274@linutronix.de



+17 -13
+3
include/linux/clocksource.h
··· 34 34 VDSO_ARCH_CLOCKMODES, 35 35 #endif 36 36 VDSO_CLOCKMODE_MAX, 37 + 38 + /* Indicator for time namespace VDSO */ 39 + VDSO_CLOCKMODE_TIMENS = INT_MAX 37 40 }; 38 41 39 42 /**
-2
include/vdso/datapage.h
··· 21 21 #define CS_RAW 1 22 22 #define CS_BASES (CS_RAW + 1) 23 23 24 - #define VCLOCK_TIMENS UINT_MAX 25 - 26 24 /** 27 25 * struct vdso_timestamp - basetime per clock_id 28 26 * @sec: seconds
+4 -3
kernel/time/namespace.c
··· 8 8 #include <linux/user_namespace.h> 9 9 #include <linux/sched/signal.h> 10 10 #include <linux/sched/task.h> 11 + #include <linux/clocksource.h> 11 12 #include <linux/seq_file.h> 12 13 #include <linux/proc_ns.h> 13 14 #include <linux/export.h> ··· 173 172 * for vdso_data->clock_mode is a non-issue. The task is spin waiting for the 174 173 * update to finish and for 'seq' to become even anyway. 175 174 * 176 - * Timens page has vdso_data->clock_mode set to VCLOCK_TIMENS which enforces 177 - * the time namespace handling path. 175 + * Timens page has vdso_data->clock_mode set to VDSO_CLOCKMODE_TIMENS which 176 + * enforces the time namespace handling path. 178 177 */ 179 178 static void timens_setup_vdso_data(struct vdso_data *vdata, 180 179 struct time_namespace *ns) ··· 184 183 struct timens_offset boottime = offset_from_ts(ns->offsets.boottime); 185 184 186 185 vdata->seq = 1; 187 - vdata->clock_mode = VCLOCK_TIMENS; 186 + vdata->clock_mode = VDSO_CLOCKMODE_TIMENS; 188 187 offset[CLOCK_MONOTONIC] = monotonic; 189 188 offset[CLOCK_MONOTONIC_RAW] = monotonic; 190 189 offset[CLOCK_MONOTONIC_COARSE] = monotonic;
+10 -8
lib/vdso/gettimeofday.c
··· 116 116 117 117 do { 118 118 /* 119 - * Open coded to handle VCLOCK_TIMENS. Time namespace 119 + * Open coded to handle VDSO_CLOCKMODE_TIMENS. Time namespace 120 120 * enabled tasks have a special VVAR page installed which 121 121 * has vd->seq set to 1 and vd->clock_mode set to 122 - * VCLOCK_TIMENS. For non time namespace affected tasks 122 + * VDSO_CLOCKMODE_TIMENS. For non time namespace affected tasks 123 123 * this does not affect performance because if vd->seq is 124 124 * odd, i.e. a concurrent update is in progress the extra 125 125 * check for vd->clock_mode is just a few extra ··· 128 128 */ 129 129 while (unlikely((seq = READ_ONCE(vd->seq)) & 1)) { 130 130 if (IS_ENABLED(CONFIG_TIME_NS) && 131 - vd->clock_mode == VCLOCK_TIMENS) 131 + vd->clock_mode == VDSO_CLOCKMODE_TIMENS) 132 132 return do_hres_timens(vd, clk, ts); 133 133 cpu_relax(); 134 134 } ··· 200 200 201 201 do { 202 202 /* 203 - * Open coded to handle VCLOCK_TIMENS. See comment in 203 + * Open coded to handle VDSO_CLOCK_TIMENS. See comment in 204 204 * do_hres(). 205 205 */ 206 206 while ((seq = READ_ONCE(vd->seq)) & 1) { 207 207 if (IS_ENABLED(CONFIG_TIME_NS) && 208 - vd->clock_mode == VCLOCK_TIMENS) 208 + vd->clock_mode == VDSO_CLOCKMODE_TIMENS) 209 209 return do_coarse_timens(vd, clk, ts); 210 210 cpu_relax(); 211 211 } ··· 292 292 293 293 if (unlikely(tz != NULL)) { 294 294 if (IS_ENABLED(CONFIG_TIME_NS) && 295 - vd->clock_mode == VCLOCK_TIMENS) 295 + vd->clock_mode == VDSO_CLOCKMODE_TIMENS) 296 296 vd = __arch_get_timens_vdso_data(); 297 297 298 298 tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest; ··· 308 308 const struct vdso_data *vd = __arch_get_vdso_data(); 309 309 __kernel_old_time_t t; 310 310 311 - if (IS_ENABLED(CONFIG_TIME_NS) && vd->clock_mode == VCLOCK_TIMENS) 311 + if (IS_ENABLED(CONFIG_TIME_NS) && 312 + vd->clock_mode == VDSO_CLOCKMODE_TIMENS) 312 313 vd = __arch_get_timens_vdso_data(); 313 314 314 315 t = READ_ONCE(vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec); ··· 333 332 if (unlikely((u32) clock >= MAX_CLOCKS)) 334 333 return -1; 335 334 336 - if (IS_ENABLED(CONFIG_TIME_NS) && vd->clock_mode == VCLOCK_TIMENS) 335 + if (IS_ENABLED(CONFIG_TIME_NS) && 336 + vd->clock_mode == VDSO_CLOCKMODE_TIMENS) 337 337 vd = __arch_get_timens_vdso_data(); 338 338 339 339 /*