]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
The vmtotal sysctl handler marks active vm objects to calculate
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 21 Jun 2016 17:49:33 +0000 (17:49 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 21 Jun 2016 17:49:33 +0000 (17:49 +0000)
commitd3b9828d0d5c375d438e6a76493640c4b018e7a1
treeaae128bb7be590a4e5932a9f3331886af64947a3
parent4f5ec72aa42401b2a7663df78d9d5c440542daec
The vmtotal sysctl handler marks active vm objects to calculate
statistics.  Marking is done by setting the OBJ_ACTIVE flag.  The
flags change is locked, but the problem is that many parts of system
assume that vm object initialization ensures that no other code could
change the object, and thus performed lockless.  The end result is
corrupted flags in vm objects, most visible is spurious OBJ_DEAD flag,
causing random hangs.

Avoid the active object marking, instead provide equally inexact but
immutable is_object_alive() definition for the object mapped state.

Avoid iterating over the processes mappings altogether by using
arguably improved definition of the paging thread as one which sleeps
on the v_free_count.

PR: 204764
Diagnosed by: pho
Tested by: pho (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (gjb)
sys/vm/vm_meter.c
sys/vm/vm_object.h