Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Rather than keeping a separate mutex, condvar, and p...



details:   https://anonhg.NetBSD.org/src/rev/4500326a7485
branches:  trunk
changeset: 967505:4500326a7485
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Dec 12 02:15:42 2019 +0000

description:
Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !

diffstat:

 sys/arch/amd64/amd64/netbsd32_machdep.c        |  10 +++---
 sys/arch/amd64/amd64/netbsd32_machdep_16.c     |   6 ++--
 sys/arch/mips/mips/netbsd32_machdep.c          |   6 ++--
 sys/arch/mips/mips/netbsd32_machdep_16.c       |   6 ++--
 sys/arch/sparc64/sparc64/netbsd32_machdep.c    |   6 ++--
 sys/arch/sparc64/sparc64/netbsd32_machdep_16.c |   6 ++--
 sys/compat/common/bio_30.c                     |   6 ++--
 sys/compat/common/ccd_60.c                     |   6 ++--
 sys/compat/common/clockctl_50.c                |   7 ++--
 sys/compat/common/compat_sysv_50_mod.c         |   7 ++--
 sys/compat/common/ieee80211_20.c               |   6 ++--
 sys/compat/common/if43_20.c                    |   6 ++--
 sys/compat/common/if_43.c                      |   8 ++--
 sys/compat/common/if_media_80.c                |   8 ++---
 sys/compat/common/if_spppsubr50.c              |   6 ++--
 sys/compat/common/kern_mod_80.c                |   6 ++--
 sys/compat/common/kern_sig_16.c                |   7 ++--
 sys/compat/common/kern_uipc_socket_50.c        |  13 +++-----
 sys/compat/common/rndpseudo_50.c               |   6 ++--
 sys/compat/common/rtsock_14.c                  |   8 ++--
 sys/compat/common/rtsock_50.c                  |  25 +++++++---------
 sys/compat/common/rtsock_70.c                  |   9 ++---
 sys/compat/common/sysmon_power_40.c            |   7 ++--
 sys/compat/common/tty_43.c                     |   6 ++--
 sys/compat/common/tty_60.c                     |   8 ++--
 sys/compat/common/uipc_syscalls_40.c           |   6 ++--
 sys/compat/common/uipc_syscalls_50.c           |   4 +-
 sys/compat/common/uipc_usrreq_70.c             |   7 ++--
 sys/compat/common/usb_subr_30.c                |   9 ++---
 sys/compat/common/vfs_syscalls_10.c            |   6 ++--
 sys/compat/common/vnd_30.c                     |   6 ++--
 sys/compat/common/vnd_50.c                     |   6 ++--
 sys/compat/netbsd32/netbsd32_compat_50.c       |   6 ++--
 sys/compat/netbsd32/netbsd32_compat_80.c       |   7 ++--
 sys/compat/netbsd32/netbsd32_kern_proc.c       |   9 ++---
 sys/compat/sunos/sunos_mod.c                   |   7 ++--
 sys/compat/sunos32/sunos32_mod.c               |   7 ++--
 sys/dev/raidframe/rf_compat32.c                |   4 +-
 sys/dev/raidframe/rf_compat50.c                |   4 +-
 sys/dev/raidframe/rf_compat80.c                |   4 +-
 sys/dev/wscons/wsevent_50.c                    |   6 ++--
 sys/fs/puffs/puffs_compat.c                    |   8 ++--
 sys/kern/kern_core.c                           |  19 +++++-------
 sys/kern/kern_module.c                         |  14 ++++++++-
 sys/net/if_vlan.c                              |   6 ++--
 sys/opencrypto/ocryptodev.c                    |   6 ++--
 sys/sys/module_hook.h                          |  37 +++++++++++--------------
 sys/sys/param.h                                |   4 +-
 48 files changed, 186 insertions(+), 201 deletions(-)

diffs (truncated from 1407 to 300 lines):

diff -r f5764f22c5ab -r 4500326a7485 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.132 2019/11/27 09:16:58 rin Exp $       */
+/*     $NetBSD: netbsd32_machdep.c,v 1.133 2019/12/12 02:15:42 pgoyette Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.132 2019/11/27 09:16:58 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.133 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1030,10 +1030,10 @@
 netbsd32_machdep_md_init(void)
 {
 
-       MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
+       MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
        MODULE_HOOK_SET(netbsd32_reg_validate_hook,
-           "mcontext32from64_validate", cpu_mcontext32from64_validate);
-       MODULE_HOOK_SET(netbsd32_process_doxmmregs_hook, "xmm32",
+           cpu_mcontext32from64_validate);
+       MODULE_HOOK_SET(netbsd32_process_doxmmregs_hook,
            netbsd32_process_doxmmregs);
 }
 
diff -r f5764f22c5ab -r 4500326a7485 sys/arch/amd64/amd64/netbsd32_machdep_16.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $ */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -250,7 +250,7 @@
 netbsd32_machdep_md_16_init(void)
 {
 
-       MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
+       MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/arch/mips/mips/netbsd32_machdep.c
--- a/sys/arch/mips/mips/netbsd32_machdep.c     Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep.c     Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.19 2019/11/20 19:37:52 pgoyette Exp $   */
+/*     $NetBSD: netbsd32_machdep.c,v 1.20 2019/12/12 02:15:42 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.19 2019/11/20 19:37:52 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.20 2019/12/12 02:15:42 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -328,7 +328,7 @@
 netbsd32_machdep_md_init(void) 
 {
 
-       MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
+       MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/arch/mips/mips/netbsd32_machdep_16.c
--- a/sys/arch/mips/mips/netbsd32_machdep_16.c  Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep_16.c  Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $ */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -98,7 +98,7 @@
 netbsd32_machdep_md_16_init(void)
 {       
                 
-       MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16); 
+       MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16); 
 }               
                 
 void            
diff -r f5764f22c5ab -r 4500326a7485 sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.114 2019/11/20 19:37:53 pgoyette Exp $  */
+/*     $NetBSD: netbsd32_machdep.c,v 1.115 2019/12/12 02:15:42 pgoyette Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.114 2019/11/20 19:37:53 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1027,7 +1027,7 @@
 netbsd32_machdep_md_init(void) 
 {
 
-       MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
+       MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/arch/sparc64/sparc64/netbsd32_machdep_16.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep_16.c    Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep_16.c    Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.3 2019/03/01 11:06:55 pgoyette Exp $ */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.3 2019/03/01 11:06:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -352,7 +352,7 @@
 netbsd32_machdep_md_16_init(void)
 {
 
-       MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
+       MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16);
 }
  
 void    
diff -r f5764f22c5ab -r 4500326a7485 sys/compat/common/bio_30.c
--- a/sys/compat/common/bio_30.c        Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/compat/common/bio_30.c        Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bio_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
+/*     $NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
 /*     $OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $   */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -96,7 +96,7 @@
 bio_30_init(void)
 {
 
-       MODULE_HOOK_SET(compat_bio_30_hook, "bio_30", compat_30_bio);
+       MODULE_HOOK_SET(compat_bio_30_hook, compat_30_bio);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/compat/common/ccd_60.c
--- a/sys/compat/common/ccd_60.c        Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/compat/common/ccd_60.c        Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccd_60.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $     */
+/*     $NetBSD: ccd_60.c,v 1.11 2019/12/12 02:15:42 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.11 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -95,7 +95,7 @@
 ccd_60_init(void)
 {
 
-       MODULE_HOOK_SET(ccd_ioctl_60_hook, "ccd_60", compat_60_ccdioctl);
+       MODULE_HOOK_SET(ccd_ioctl_60_hook, compat_60_ccdioctl);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/compat/common/clockctl_50.c
--- a/sys/compat/common/clockctl_50.c   Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/compat/common/clockctl_50.c   Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: clockctl_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
+/*      $NetBSD: clockctl_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clockctl_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clockctl_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -130,8 +130,7 @@
 clockctl_50_init(void)
 {
 
-       MODULE_HOOK_SET(clockctl_ioctl_50_hook, "clk_50",
-           compat50_clockctlioctl);
+       MODULE_HOOK_SET(clockctl_ioctl_50_hook, compat50_clockctlioctl);
 }
 
 void
diff -r f5764f22c5ab -r 4500326a7485 sys/compat/common/compat_sysv_50_mod.c
--- a/sys/compat/common/compat_sysv_50_mod.c    Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/compat/common/compat_sysv_50_mod.c    Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_sysv_50_mod.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $  */
+/*     $NetBSD: compat_sysv_50_mod.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -75,8 +75,7 @@
                if (error != 0) {
                        break;
                }
-               MODULE_HOOK_SET(sysvipc_sysctl_50_hook, "sysv50",
-                   sysctl_kern_sysvipc50);
+               MODULE_HOOK_SET(sysvipc_sysctl_50_hook, sysctl_kern_sysvipc50);
                break;
 
        case MODULE_CMD_FINI:
diff -r f5764f22c5ab -r 4500326a7485 sys/compat/common/ieee80211_20.c
--- a/sys/compat/common/ieee80211_20.c  Thu Dec 12 00:46:31 2019 +0000
+++ b/sys/compat/common/ieee80211_20.c  Thu Dec 12 02:15:42 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211_20.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $        */
+/*     $NetBSD: ieee80211_20.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $        */
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
 #endif
 
 /*
@@ -119,7 +119,7 @@
 ieee80211_20_init(void)
 {
 
-       MODULE_HOOK_SET(ieee80211_ioctl_20_hook, "ieee20", ieee80211_20_ioctl);



Home | Main Index | Thread Index | Old Index