Source-Changes-HG archive

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

[src/trunk]: src/sys Mark some variables __read_mostly.



details:   https://anonhg.NetBSD.org/src/rev/2edfbf36a9a4
branches:  trunk
changeset: 337624:2edfbf36a9a4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Apr 21 12:55:57 2015 +0000

description:
Mark some variables __read_mostly.

diffstat:

 sys/dev/rndpseudo.c  |  10 +++++-----
 sys/kern/kern_rndq.c |   9 +++++----
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r 74087dcb7b2c -r 2edfbf36a9a4 sys/dev/rndpseudo.c
--- a/sys/dev/rndpseudo.c       Tue Apr 21 12:47:33 2015 +0000
+++ b/sys/dev/rndpseudo.c       Tue Apr 21 12:55:57 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rndpseudo.c,v 1.33 2015/04/21 12:51:53 riastradh Exp $ */
+/*     $NetBSD: rndpseudo.c,v 1.34 2015/04/21 12:57:03 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.33 2015/04/21 12:51:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rndpseudo.c,v 1.34 2015/04/21 12:57:03 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -87,7 +87,7 @@
  */
 #define        RND_TEMP_BUFFER_SIZE    512
 
-static pool_cache_t rnd_temp_buffer_cache;
+static pool_cache_t rnd_temp_buffer_cache __read_mostly;
 
 /*
  * Per-open state -- a lazily initialized CPRNG.
@@ -97,12 +97,12 @@
        bool                    rc_hard;
 };
 
-static pool_cache_t rnd_ctx_cache;
+static pool_cache_t rnd_ctx_cache __read_mostly;
 
 /*
  * The per-CPU RNGs used for short requests
  */
-static percpu_t *percpu_urandom_cprng;
+static percpu_t *percpu_urandom_cprng __read_mostly;
 
 /* Used by ioconf.c to attach the rnd pseudo-device.  */
 void   rndattach(int);
diff -r 74087dcb7b2c -r 2edfbf36a9a4 sys/kern/kern_rndq.c
--- a/sys/kern/kern_rndq.c      Tue Apr 21 12:47:33 2015 +0000
+++ b/sys/kern/kern_rndq.c      Tue Apr 21 12:55:57 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rndq.c,v 1.69 2015/04/21 12:07:31 riastradh Exp $ */
+/*     $NetBSD: kern_rndq.c,v 1.70 2015/04/21 12:55:57 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.69 2015/04/21 12:07:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.70 2015/04/21 12:55:57 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -117,7 +117,7 @@
 /*
  * Memory pool for sample buffers
  */
-static pool_cache_t rnd_mempc;
+static pool_cache_t rnd_mempc __read_mostly;
 
 /*
  * Global entropy pool and sources.
@@ -148,7 +148,8 @@
 
 krndsource_t rnd_printf_source, rnd_autoconf_source;
 
-static void *rnd_process, *rnd_wakeup;
+static void *rnd_process __read_mostly;
+static void *rnd_wakeup __read_mostly;
 
 static inline uint32_t rnd_counter(void);
 static        void     rnd_intr(void *);



Home | Main Index | Thread Index | Old Index