OpenBSD Journal

mmap(2), munmap(2), and mprotect(2) unlocked

Contributed by rueda on from the woosh! dept.

Martin Pieuchot (mpi@) has committed a change unlocking the mmap(2), munmap(2), and mprotect(2) system calls:

CVSROOT:	/cvs
Module name:	src
Changes by:	mpi@cvs.openbsd.org	2022/11/08 04:05:57

Modified files:
	sys/kern       : syscalls.master 

Log message:
Mark mmap(2), munmap(2) and mprotect(2) as NOLOCK.

Accesses to data structures used by these syscalls are serialized by the
VM map lock with the exception of file mappings which are still protected
by the KERNEL_LOCK().

Unlocking this set of syscalls improves most of userland workloads.

Tested by many including robert@ (since 2 years), mlarkin@, kn@, sdk@,
jca@, aoyama@, naddy@, Scott Bennett and others. Thanks to all!

Joint work with kn@.

ok robert@, aja@, kettenis@, kn@, deraadt@, beck@

The improvement in workload performance can be quite marked. Following Martin's request for testing, Mike Larkin (mlarkin@) reported build performance improvement of over 12%!

(Comments are closed)


Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]