From beck@cvs.openbsd.org Mon Feb 9 20:13:27 2015 Delivered-To: david@gwynne.id.au Received: by 10.217.142.208 with SMTP id et58csp2305212web; Mon, 9 Feb 2015 02:13:28 -0800 (PST) X-Received: by 10.170.115.209 with SMTP id h200mr6116335ykb.87.1423476807302; Mon, 09 Feb 2015 02:13:27 -0800 (PST) Return-Path: Received: from cvs.openbsd.org (cvs.openbsd.org. [199.185.137.3]) by mx.google.com with ESMTPS id d79si2193764ykb.49.2015.02.09.02.13.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Feb 2015 02:13:27 -0800 (PST) Received-SPF: none (google.com: beck@cvs.openbsd.org does not designate permitted sender hosts) client-ip=199.185.137.3; Authentication-Results: mx.google.com; spf=none (google.com: beck@cvs.openbsd.org does not designate permitted sender hosts) smtp.mail=beck@cvs.openbsd.org Received: from localhost (cvs.openbsd.org [local]); by cvs.openbsd.org (OpenSMTPD) with ESMTPA id 196f2362; for ; Mon, 9 Feb 2015 03:13:25 -0700 (MST) From: Bob Beck Date: Mon, 9 Feb 2015 03:13:25 -0700 (MST) Message-Id: <7227690861960191152.enqueue@cvs.openbsd.org> To: dlg@openbsd.org Subject: try this and compare Status: RO Content-Length: 4371 Lines: 118 Index: kern/init_sysent.c =================================================================== RCS file: /cvs/src/sys/kern/init_sysent.c,v retrieving revision 1.161 diff -u -p -u -p -r1.161 init_sysent.c --- kern/init_sysent.c 8 Dec 2014 20:56:34 -0000 1.161 +++ kern/init_sysent.c 8 Feb 2015 06:13:13 -0000 @@ -1,4 +1,4 @@ -/* $OpenBSD: init_sysent.c,v 1.161 2014/12/08 20:56:34 guenther Exp $ */ +/* $OpenBSD$ */ /* * System call switch table. @@ -179,7 +179,7 @@ struct sysent sysent[] = { sys_select }, /* 71 = select */ { 6, s(struct sys_kevent_args), 0, sys_kevent }, /* 72 = kevent */ - { 2, s(struct sys_munmap_args), 0, + { 2, s(struct sys_munmap_args), SY_NOLOCK | 0, sys_munmap }, /* 73 = munmap */ { 3, s(struct sys_mprotect_args), 0, sys_mprotect }, /* 74 = mprotect */ @@ -432,7 +432,7 @@ struct sysent sysent[] = { sys_setrlimit }, /* 195 = setrlimit */ { 0, 0, 0, sys_nosys }, /* 196 = obsolete ogetdirentries48 */ - { 7, s(struct sys_mmap_args), 0, + { 7, s(struct sys_mmap_args), SY_NOLOCK | 0, sys_mmap }, /* 197 = mmap */ { 0, 0, 0, sys_nosys }, /* 198 = __syscall (indir) */ Index: kern/syscalls.c =================================================================== RCS file: /cvs/src/sys/kern/syscalls.c,v retrieving revision 1.162 diff -u -p -u -p -r1.162 syscalls.c --- kern/syscalls.c 8 Dec 2014 20:56:34 -0000 1.162 +++ kern/syscalls.c 8 Feb 2015 06:13:13 -0000 @@ -1,4 +1,4 @@ -/* $OpenBSD: syscalls.c,v 1.162 2014/12/08 20:56:34 guenther Exp $ */ +/* $OpenBSD$ */ /* * System call names. Index: kern/syscalls.master =================================================================== RCS file: /cvs/src/sys/kern/syscalls.master,v retrieving revision 1.149 diff -u -p -u -p -r1.149 syscalls.master --- kern/syscalls.master 8 Dec 2014 20:56:11 -0000 1.149 +++ kern/syscalls.master 8 Feb 2015 06:13:06 -0000 @@ -170,7 +170,7 @@ const struct kevent *changelist, int nchanges, \ struct kevent *eventlist, int nevents, \ const struct timespec *timeout); } -73 STD { int sys_munmap(void *addr, size_t len); } +73 STD NOLOCK { int sys_munmap(void *addr, size_t len); } 74 STD { int sys_mprotect(void *addr, size_t len, \ int prot); } 75 STD { int sys_madvise(void *addr, size_t len, \ @@ -341,7 +341,7 @@ 195 STD { int sys_setrlimit(int which, \ const struct rlimit *rlp); } 196 OBSOL ogetdirentries48 -197 STD { void *sys_mmap(void *addr, size_t len, int prot, \ +197 STD NOLOCK { void *sys_mmap(void *addr, size_t len, int prot, \ int flags, int fd, long pad, off_t pos); } 198 INDIR { quad_t sys___syscall(quad_t num, ...); } 199 STD { off_t sys_lseek(int fd, int pad, off_t offset, \ Index: sys/syscall.h =================================================================== RCS file: /cvs/src/sys/sys/syscall.h,v retrieving revision 1.161 diff -u -p -u -p -r1.161 syscall.h --- sys/syscall.h 8 Dec 2014 20:56:34 -0000 1.161 +++ sys/syscall.h 8 Feb 2015 06:13:13 -0000 @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.161 2014/12/08 20:56:34 guenther Exp $ */ +/* $OpenBSD$ */ /* * System call numbers. Index: sys/syscallargs.h =================================================================== RCS file: /cvs/src/sys/sys/syscallargs.h,v retrieving revision 1.163 diff -u -p -u -p -r1.163 syscallargs.h --- sys/syscallargs.h 8 Dec 2014 20:56:34 -0000 1.163 +++ sys/syscallargs.h 8 Feb 2015 06:13:13 -0000 @@ -1,4 +1,4 @@ -/* $OpenBSD: syscallargs.h,v 1.163 2014/12/08 20:56:34 guenther Exp $ */ +/* $OpenBSD$ */ /* * System call argument lists. Index: uvm/uvm_amap.c =================================================================== RCS file: /cvs/src/sys/uvm/uvm_amap.c,v retrieving revision 1.58 diff -u -p -u -p -r1.58 uvm_amap.c --- uvm/uvm_amap.c 23 Dec 2014 04:56:47 -0000 1.58 +++ uvm/uvm_amap.c 8 Feb 2015 06:12:37 -0000 @@ -716,6 +716,7 @@ void amap_splitref(struct vm_aref *origref, struct vm_aref *splitref, vaddr_t offset) { int leftslots; + KERNEL_LOCK(); AMAP_B2SLOT(leftslots, offset); if (leftslots == 0) @@ -734,6 +735,7 @@ amap_splitref(struct vm_aref *origref, s splitref->ar_amap = origref->ar_amap; splitref->ar_amap->am_ref++; /* not a share reference */ splitref->ar_pageoff = origref->ar_pageoff + leftslots; + KERNEL_UNLOCK(); } #ifdef UVM_AMAP_PPREF