Source-Changes-HG archive

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

[src/trunk]: src/tests/rump/kernspace Move proc_lock into the data segment. ...



details:   https://anonhg.NetBSD.org/src/rev/7b88f7fac5cf
branches:  trunk
changeset: 933282:7b88f7fac5cf
user:      ad <ad%NetBSD.org@localhost>
date:      Sat May 23 23:42:41 2020 +0000

description:
Move proc_lock into the data segment.  It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.

diffstat:

 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c |    8 +-
 sys/arch/vax/vax/pmap.c                             |    8 +-
 sys/arch/x68k/dev/event.c                           |    8 +-
 sys/compat/common/kern_sig_16.c                     |    8 +-
 sys/compat/common/tty_43.c                          |   12 +-
 sys/compat/linux/arch/arm/linux_ptrace.c            |   14 +-
 sys/compat/linux/arch/i386/linux_ptrace.c           |   14 +-
 sys/compat/linux/arch/powerpc/linux_ptrace.c        |   14 +-
 sys/compat/linux/common/linux_file.c                |   14 +-
 sys/compat/linux/common/linux_sched.c               |   10 +-
 sys/compat/linux/common/linux_signal.c              |   10 +-
 sys/compat/netbsd32/netbsd32_fs.c                   |    8 +-
 sys/ddb/db_xxx.c                                    |   10 +-
 sys/dev/audio/audio.c                               |   12 +-
 sys/dev/lockstat.c                                  |    8 +-
 sys/dev/midi.c                                      |   12 +-
 sys/dev/pci/bktr/bktr_core.c                        |   18 +-
 sys/dev/sbus/bpp.c                                  |   16 +-
 sys/dev/sequencer.c                                 |   12 +-
 sys/dev/usb/uhid.c                                  |   38 +++---
 sys/dev/usb/usb.c                                   |   20 +-
 sys/dev/wscons/wsdisplay_compat_usl.c               |   10 +-
 sys/dev/wscons/wsevent.c                            |    8 +-
 sys/external/bsd/drm/dist/bsd-core/drm_irq.c        |    4 +-
 sys/external/bsd/drm2/drm/drm_lock.c                |    8 +-
 sys/fs/autofs/autofs.c                              |   22 +-
 sys/kern/core_elf32.c                               |    8 +-
 sys/kern/init_main.c                                |   22 +-
 sys/kern/init_sysctl.c                              |   18 +-
 sys/kern/kern_acct.c                                |    8 +-
 sys/kern/kern_core.c                                |   16 +-
 sys/kern/kern_cpu.c                                 |   10 +-
 sys/kern/kern_descrip.c                             |   28 ++--
 sys/kern/kern_event.c                               |   10 +-
 sys/kern/kern_exec.c                                |   38 +++---
 sys/kern/kern_exit.c                                |   40 +++---
 sys/kern/kern_fork.c                                |   16 +-
 sys/kern/kern_ktrace.c                              |   14 +-
 sys/kern/kern_lwp.c                                 |   26 ++--
 sys/kern/kern_proc.c                                |  113 +++++++++----------
 sys/kern/kern_prot.c                                |   24 ++--
 sys/kern/kern_resource.c                            |   22 +-
 sys/kern/kern_sig.c                                 |   76 ++++++------
 sys/kern/kern_stub.c                                |    8 +-
 sys/kern/kern_synch.c                               |   12 +-
 sys/kern/kern_syscall.c                             |    8 +-
 sys/kern/kern_tc.c                                  |    8 +-
 sys/kern/kern_time.c                                |    8 +-
 sys/kern/subr_copy.c                                |   10 +-
 sys/kern/subr_exec_fd.c                             |    8 +-
 sys/kern/subr_prf.c                                 |   18 +-
 sys/kern/subr_time.c                                |   10 +-
 sys/kern/sys_aio.c                                  |   12 +-
 sys/kern/sys_generic.c                              |   12 +-
 sys/kern/sys_lwp.c                                  |   12 +-
 sys/kern/sys_mqueue.c                               |    8 +-
 sys/kern/sys_pset.c                                 |   18 +-
 sys/kern/sys_ptrace_common.c                        |   12 +-
 sys/kern/sys_sched.c                                |   16 +-
 sys/kern/sys_sig.c                                  |   14 +-
 sys/kern/tty.c                                      |   80 +++++++-------
 sys/kern/tty_tty.c                                  |    8 +-
 sys/kern/uipc_socket2.c                             |    8 +-
 sys/kern/uipc_syscalls.c                            |    8 +-
 sys/kern/vfs_mount.c                                |   12 +-
 sys/kern/vfs_vnops.c                                |   12 +-
 sys/miscfs/procfs/procfs_limit.c                    |    8 +-
 sys/miscfs/procfs/procfs_linux.c                    |   12 +-
 sys/miscfs/procfs/procfs_status.c                   |   12 +-
 sys/miscfs/procfs/procfs_subr.c                     |   11 +-
 sys/miscfs/procfs/procfs_vfsops.c                   |    8 +-
 sys/miscfs/procfs/procfs_vnops.c                    |   12 +-
 sys/miscfs/specfs/spec_vnops.c                      |   10 +-
 sys/nfs/nfs_bio.c                                   |   12 +-
 sys/rump/librump/rumpkern/lwproc.c                  |   26 ++--
 sys/rump/librump/rumpkern/rump.c                    |    8 +-
 sys/rump/librump/rumpkern/signals.c                 |    6 +-
 sys/sys/proc.h                                      |    4 +-
 sys/ufs/chfs/chfs_vnops.c                           |    6 +-
 sys/uvm/uvm_meter.c                                 |    8 +-
 tests/rump/kernspace/sendsig.c                      |   10 +-
 81 files changed, 645 insertions(+), 645 deletions(-)

diffs (truncated from 5009 to 300 lines):

diff -r c648ba08e4f6 -r 7b88f7fac5cf external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sat May 23 23:37:17 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sat May 23 23:42:41 2020 +0000
@@ -7255,9 +7255,9 @@
 
 #ifdef __NetBSD__
        struct proc *p = curproc;
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        psignal(p, sig);
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
 #endif
 }
 
@@ -7283,9 +7283,9 @@
 
 #ifdef __NetBSD__
        struct proc *p = curproc;
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        psignal(p, SIGSTOP);
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
 #endif
 }
 
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/arch/vax/vax/pmap.c
--- a/sys/arch/vax/vax/pmap.c   Sat May 23 23:37:17 2020 +0000
+++ b/sys/arch/vax/vax/pmap.c   Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.190 2020/03/21 18:47:54 ad Exp $       */
+/*     $NetBSD: pmap.c,v 1.191 2020/05/23 23:42:41 ad Exp $       */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.190 2020/03/21 18:47:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.191 2020/05/23 23:42:41 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -688,7 +688,7 @@
 
        outl = outl2 = NULL;
        outpri = outpri2 = 0;
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        LIST_FOREACH(l, &alllwp, l_list) {
                if (!pmap_vax_swappable(l, pm))
                        continue;
@@ -715,7 +715,7 @@
                        continue;
                }
        }
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
        if (didswap == 0) {
                if ((l = outl) == NULL)
                        l = outl2;
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/arch/x68k/dev/event.c
--- a/sys/arch/x68k/dev/event.c Sat May 23 23:37:17 2020 +0000
+++ b/sys/arch/x68k/dev/event.c Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.c,v 1.15 2017/10/25 08:12:38 maya Exp $ */
+/*     $NetBSD: event.c,v 1.16 2020/05/23 23:42:41 ad Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.15 2017/10/25 08:12:38 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.16 2020/05/23 23:42:41 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -177,9 +177,9 @@
        mutex_exit(ev->ev_lock);
 
        if (ev->ev_async) {
-               mutex_enter(proc_lock);
+               mutex_enter(&proc_lock);
                psignal(ev->ev_io, SIGIO);
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
        }
 }
 
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/compat/common/kern_sig_16.c
--- a/sys/compat/common/kern_sig_16.c   Sat May 23 23:37:17 2020 +0000
+++ b/sys/compat/common/kern_sig_16.c   Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
+/*     $NetBSD: kern_sig_16.c,v 1.6 2020/05/23 23:42:41 ad Exp $       */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.6 2020/05/23 23:42:41 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -177,13 +177,13 @@
         * further processes while we are here.  See
         * sigaction1() for the opposing half.
         */
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        PROCLIST_FOREACH(p, &allproc) {
                if ((p->p_lflag & PL_SIGCOMPAT) != 0) {
                        break;
                }
        }
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
        if (p != NULL) {
                syscall_establish(NULL, kern_sig_16_syscalls);
                return EBUSY;
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/compat/common/tty_43.c
--- a/sys/compat/common/tty_43.c        Sat May 23 23:37:17 2020 +0000
+++ b/sys/compat/common/tty_43.c        Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_43.c,v 1.35 2019/12/12 02:15:42 pgoyette Exp $     */
+/*     $NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.35 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -274,17 +274,17 @@
                break;
 
        case TIOCGSID:
-               mutex_enter(proc_lock);
+               mutex_enter(&proc_lock);
                if (tp->t_session == NULL) {
-                       mutex_exit(proc_lock);
+                       mutex_exit(&proc_lock);
                        return ENOTTY;
                }
                if (tp->t_session->s_leader == NULL) {
-                       mutex_exit(proc_lock);
+                       mutex_exit(&proc_lock);
                        return ENOTTY;
                }
                *(int *) data =  tp->t_session->s_leader->p_pid;
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                break;
 
        default:
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/compat/linux/arch/arm/linux_ptrace.c
--- a/sys/compat/linux/arch/arm/linux_ptrace.c  Sat May 23 23:37:17 2020 +0000
+++ b/sys/compat/linux/arch/arm/linux_ptrace.c  Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_ptrace.c,v 1.21 2018/01/26 09:29:15 christos Exp $       */
+/*     $NetBSD: linux_ptrace.c,v 1.22 2020/05/23 23:42:41 ad Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.21 2018/01/26 09:29:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.22 2020/05/23 23:42:41 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -133,9 +133,9 @@
        }
 
        /* Find the process we are supposed to be operating on. */
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        if ((t = proc_find(SCARG(uap, pid))) == NULL) {
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = ESRCH;
                goto out;
        }
@@ -147,7 +147,7 @@
         */
        if (!ISSET(t->p_slflag, PSL_TRACED)) {
                mutex_exit(t->p_lock);
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = EPERM;
                goto out;
        }
@@ -159,11 +159,11 @@
         */
        if (t->p_pptr != p || t->p_stat != SSTOP || !t->p_waited) {
                mutex_exit(t->p_lock);
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = EBUSY;
                goto out;
        }
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
        /* XXX: ptrace needs revamp for multi-threading support. */
        if (t->p_nlwps > 1) {
                mutex_exit(t->p_lock);
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/compat/linux/arch/i386/linux_ptrace.c
--- a/sys/compat/linux/arch/i386/linux_ptrace.c Sat May 23 23:37:17 2020 +0000
+++ b/sys/compat/linux/arch/i386/linux_ptrace.c Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_ptrace.c,v 1.33 2018/09/03 16:29:29 riastradh Exp $      */
+/*     $NetBSD: linux_ptrace.c,v 1.34 2020/05/23 23:42:41 ad Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.33 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.34 2020/05/23 23:42:41 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -178,9 +178,9 @@
        }
 
        /* Find the process we are supposed to be operating on. */
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        if ((t = proc_find(SCARG(uap, pid))) == NULL) {
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = ESRCH;
                goto out;
        }
@@ -192,7 +192,7 @@
         */
        if (!ISSET(t->p_slflag, PSL_TRACED)) {
                mutex_exit(t->p_lock);
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = EPERM;
                goto out;
        }
@@ -202,11 +202,11 @@
         */
        if (t->p_pptr != p || t->p_stat != SSTOP || !t->p_waited) {
                mutex_exit(t->p_lock);
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);
                error = EBUSY;
                goto out;
        }
-       mutex_exit(proc_lock);
+       mutex_exit(&proc_lock);
        /* XXX: ptrace needs revamp for multi-threading support. */
        if (t->p_nlwps > 1) {
                mutex_exit(t->p_lock);
diff -r c648ba08e4f6 -r 7b88f7fac5cf sys/compat/linux/arch/powerpc/linux_ptrace.c
--- a/sys/compat/linux/arch/powerpc/linux_ptrace.c      Sat May 23 23:37:17 2020 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_ptrace.c      Sat May 23 23:42:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_ptrace.c,v 1.31 2018/09/03 16:29:29 riastradh Exp $ */
+/*     $NetBSD: linux_ptrace.c,v 1.32 2020/05/23 23:42:41 ad Exp $ */
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.31 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.32 2020/05/23 23:42:41 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -155,9 +155,9 @@
        }
 
        /* Find the process we are supposed to be operating on. */
-       mutex_enter(proc_lock);
+       mutex_enter(&proc_lock);
        if ((t = proc_find(SCARG(uap, pid))) == NULL) {
-               mutex_exit(proc_lock);
+               mutex_exit(&proc_lock);



Home | Main Index | Thread Index | Old Index