1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00
Mirror of the FreeBSD src repository https://git.FreeBSD.org/src.git .
Go to file
Konstantin Belousov b7b8a09658 Handle the race between fork/vm_object_split() and faults.
If fault started before vmspace_fork() locked the map, and then during
fork, vm_map_copy_entry()->vm_object_split() is executed, it is
possible that the fault instantiate the page into the original object
when the page was already copied into the new object (see
vm_map_split() for the orig/new objects terminology). This can happen
if split found a busy page (e.g. from the fault) and slept dropping
the objects lock, which allows the swap pager to instantiate
read-behind pages for the fault.  Then the restart of the scan can see
a page in the scanned range, where it was already copied to the upper
object.

Fix it by instantiating the read-ahead pages before
swap_pager_getpages() method drops the lock to allocate pbuf.  The
object scan would see the whole range prefilled with the busy pages
and not proceed the range.

Note that vm_fault rechecks the map generation count after the object
unlock, so that it restarts the handling if raced with split, and
re-lookups the right page from the upper object.

In collaboration with:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-06-14 19:41:02 +00:00
bin ps(1): fix some nits 2018-06-13 00:45:35 +00:00
cddl Process CUs with a language attribute of DW_LANG_Mips_Assembler. 2018-06-11 16:33:36 +00:00
contrib Add DW_LANG_* definitions from DWARF 4 and 5. 2018-06-09 14:50:38 +00:00
crypto Merge upstream patch to unbreak tunnel forwarding. 2018-05-16 14:04:39 +00:00
etc devmatch: Address some rc nits 2018-06-14 16:09:29 +00:00
gnu Use a script wrapper for <compress>grep 2018-04-25 13:23:58 +00:00
include dts: Import files from Linux 4.17 2018-06-14 06:56:07 +00:00
kerberos5 various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
lib Fix style(9) space vs tab. 2018-06-14 01:28:55 +00:00
libexec Make rtld use libc_nossp_pic.a. Remove SSP shims. 2018-05-09 10:30:56 +00:00
release Enable USB OTG serial terminal on ARM SD card images. This configures 2018-06-12 16:45:52 +00:00
rescue Avoid referencing private lib names directly. 2017-11-10 07:53:02 +00:00
sbin NVME support is only for x86 and powerpc64. 2018-06-14 01:15:19 +00:00
secure Upgrade to OpenSSH 7.7p1. 2018-05-11 13:22:43 +00:00
share rk_i2c: Add manpage for this driver 2018-06-14 07:59:47 +00:00
stand libsa: open() should use NULL instead of typecasted 0 2018-06-14 16:11:50 +00:00
sys Handle the race between fork/vm_object_split() and faults. 2018-06-14 19:41:02 +00:00
targets Add kernel and userspace code to dump the firmware state of supported 2018-03-08 15:21:56 +00:00
tests audit(4): add tests for fhopen, fhstat, and fhstatfs 2018-06-14 15:04:49 +00:00
tools WITHOUT_NLS cleanup of more empty dirs. 2018-06-12 19:26:25 +00:00
usr.bin top(1): remove myself from top.1 2018-06-14 12:14:51 +00:00
usr.sbin Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.gitattributes .git*: add gitattributes and gitignore 2017-12-25 21:07:54 +00:00
.gitignore .git*: add gitattributes and gitignore 2017-12-25 21:07:54 +00:00
COPYRIGHT Remove 'All Rights Reserved' from the collection copyright and templates. 2018-05-09 02:02:49 +00:00
LOCKS LOCKS: update current locks 2018-06-09 03:08:04 +00:00
MAINTAINERS Pass on bhyve kernel module maintenance to 2018-06-10 04:25:19 +00:00
Makefile Restore arm, riscv, sparc64, and mips to UNIVERSE after r334128 2018-05-24 14:01:22 +00:00
Makefile.inc1 Bump __FreeBSD_version after r334881 and force libdwarf to be rebuilt. 2018-06-09 20:01:03 +00:00
Makefile.libcompat libpmc/pmu: enable for i386 as well 2018-05-31 22:26:55 +00:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc Revert r334929 2018-06-10 19:15:38 +00:00
README README: Reduce the textdump; describe the project 2018-05-23 04:09:01 +00:00
README.md README: Reduce the textdump; describe the project 2018-05-23 04:09:01 +00:00
UPDATING Explain why a __FreeBSD_version bump was done for r334930. 2018-06-12 22:52:27 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

stand		Boot loader sources.

sys		Kernel sources.

sys/<arch>/conf Kernel configuration file

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html