]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Swap in WKILLED processes.
authorKonstantin Belousov <kib@FreeBSD.org>
Sat, 4 Aug 2018 20:45:43 +0000 (20:45 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 4 Aug 2018 20:45:43 +0000 (20:45 +0000)
commita70e9a1388d4aa928158fc9204553a89ee9c6332
tree7f797a596632ea89f1a5a6c7646eda8f28f56731
parent9f21643182a8c77df8949e8a3a425d6e5dc24baa
Swap in WKILLED processes.

Swapped-out process that is WKILLED must be swapped in as soon as
possible.  The reason is that such process can be killed by OOM and
its pages can be only freed if the process exits.  To exit, the kernel
stack of the process must be mapped.

When allocating pages for the stack of the WKILLED process on swap in,
use VM_ALLOC_SYSTEM requests to increase the chance of the allocation
to succeed.

Add counter of the swapped out processes to avoid unneeded iteration
over the allprocs list when there is no work to do, reducing the
allproc_lock ownership.

Reviewed by: alc, markj (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16489
sys/kern/kern_sig.c
sys/kern/sys_process.c
sys/sys/proc.h
sys/vm/vm_swapout.c