Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Sprinkle __cacheline_aligned and __read_mostly, mak...



details:   https://anonhg.NetBSD.org/src/rev/fd9da6924769
branches:  trunk
changeset: 764944:fd9da6924769
user:      rmind <rmind%NetBSD.org@localhost>
date:      Fri May 13 22:19:41 2011 +0000

description:
Sprinkle __cacheline_aligned and __read_mostly, make some functions static.

diffstat:

 sys/kern/kern_sleepq.c    |  10 +++++-----
 sys/kern/kern_turnstile.c |  14 +++++++-------
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (84 lines):

diff -r a7ca1787fe65 -r fd9da6924769 sys/kern/kern_sleepq.c
--- a/sys/kern/kern_sleepq.c    Fri May 13 22:16:43 2011 +0000
+++ b/sys/kern/kern_sleepq.c    Fri May 13 22:19:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sleepq.c,v 1.38 2011/04/27 08:32:42 plunky Exp $  */
+/*     $NetBSD: kern_sleepq.c,v 1.39 2011/05/13 22:19:41 rmind Exp $   */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.38 2011/04/27 08:32:42 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.39 2011/05/13 22:19:41 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -54,10 +54,10 @@
 
 #include "opt_sa.h"
 
-int    sleepq_sigtoerror(lwp_t *, int);
+static int     sleepq_sigtoerror(lwp_t *, int);
 
 /* General purpose sleep table, used by ltsleep() and condition variables. */
-sleeptab_t     sleeptab;
+sleeptab_t     sleeptab        __cacheline_aligned;
 
 /*
  * sleeptab_init:
@@ -378,7 +378,7 @@
  *
  *     Given a signal number, interpret and return an error code.
  */
-int
+static int
 sleepq_sigtoerror(lwp_t *l, int sig)
 {
        struct proc *p = l->l_proc;
diff -r a7ca1787fe65 -r fd9da6924769 sys/kern/kern_turnstile.c
--- a/sys/kern/kern_turnstile.c Fri May 13 22:16:43 2011 +0000
+++ b/sys/kern/kern_turnstile.c Fri May 13 22:19:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_turnstile.c,v 1.28 2009/11/18 12:26:22 yamt Exp $ */
+/*     $NetBSD: kern_turnstile.c,v 1.29 2011/05/13 22:19:41 rmind Exp $        */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.28 2009/11/18 12:26:22 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.29 2011/05/13 22:19:41 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/lockdebug.h>
@@ -75,12 +75,12 @@
 #define        TS_HASH_MASK    (TS_HASH_SIZE - 1)
 #define        TS_HASH(obj)    (((uintptr_t)(obj) >> 3) & TS_HASH_MASK)
 
-tschain_t      turnstile_tab[TS_HASH_SIZE];
-pool_cache_t   turnstile_cache;
+static tschain_t       turnstile_tab[TS_HASH_SIZE]     __cacheline_aligned;
+pool_cache_t           turnstile_cache                 __read_mostly;
 
-int    turnstile_ctor(void *, void *, int);
+static int             turnstile_ctor(void *, void *, int);
 
-extern turnstile_t turnstile0;
+extern turnstile_t     turnstile0;
 
 /*
  * turnstile_init:
@@ -111,7 +111,7 @@
  *
  *     Constructor for turnstiles.
  */
-int
+static int
 turnstile_ctor(void *arg, void *obj, int flags)
 {
        turnstile_t *ts = obj;



Home | Main Index | Thread Index | Old Index