Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Put time_second and time_uptime in different cache ...



details:   https://anonhg.NetBSD.org/src/rev/ae37251568a2
branches:  trunk
changeset: 829806:ae37251568a2
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Feb 13 09:26:17 2018 +0000

description:
Put time_second and time_uptime in different cache lines, probably saves
us some false sharing.

diffstat:

 sys/kern/kern_tc.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 1d349e0d386d -r ae37251568a2 sys/kern/kern_tc.c
--- a/sys/kern/kern_tc.c        Tue Feb 13 08:51:37 2018 +0000
+++ b/sys/kern/kern_tc.c        Tue Feb 13 09:26:17 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.48 2017/11/02 15:28:23 riastradh Exp $ */
+/* $NetBSD: kern_tc.c,v 1.49 2018/02/13 09:26:17 maxv Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.48 2017/11/02 15:28:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.49 2018/02/13 09:26:17 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -131,8 +131,8 @@
 struct timecounter *timecounter = &dummy_timecounter;
 static struct timecounter *timecounters = &dummy_timecounter;
 
-volatile time_t time_second = 1;
-volatile time_t time_uptime = 1;
+volatile time_t time_second __cacheline_aligned = 1;
+volatile time_t time_uptime __cacheline_aligned = 1;
 
 static struct bintime timebasebin;
 



Home | Main Index | Thread Index | Old Index