]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use a single VM object for kernel stacks.
authormarkj <markj@FreeBSD.org>
Sun, 26 Apr 2020 20:08:57 +0000 (20:08 +0000)
committermarkj <markj@FreeBSD.org>
Sun, 26 Apr 2020 20:08:57 +0000 (20:08 +0000)
commit4b7a0ef908675b6ea6f10c0d6ce7d68c5b601dbe
treecdf6d1aff582f5049312ed56e4b80dce0043d6bc
parentee1f1fbf644b617817a0ac647e8e74d0b39527ac
Use a single VM object for kernel stacks.

Previously we allocated a separate VM object for each kernel stack.
However, fully constructed kernel stacks are cached by UMA, so there is
no harm in using a single global object for all stacks.  This reduces
memory consumption and makes it easier to define a memory allocation
policy for kernel stack pages, with the aim of reducing physical memory
fragmentation.

Add a global kstack_object, and use the stack KVA address to index into
the object like we do with kernel_object.

Reviewed by: kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24473
sys/kern/kern_thread.c
sys/sys/proc.h
sys/vm/vm_extern.h
sys/vm/vm_glue.c
sys/vm/vm_kern.h
sys/vm/vm_swapout.c