]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vm: check for empty kstack cache before locking
authormjg <mjg@FreeBSD.org>
Wed, 19 Sep 2018 16:02:33 +0000 (16:02 +0000)
committermjg <mjg@FreeBSD.org>
Wed, 19 Sep 2018 16:02:33 +0000 (16:02 +0000)
commite4a8d038e78f8fe282faf2ac87807a098ea814bd
treee17245e7d4f34fb2cfeac11f62c48c07b47b0239
parent4154c108329dbaa25c57e5451015ca26694b95ce
vm: check for empty kstack cache before locking

The current cache logic checks the total number of stacks in the kernel,
which even on small boxes significantly exceeds the 128 limit (e.g. an
8-way box with zfs has almost 800 stacks allocated).

Stacks are cached earlier for each main thread.

As a result the code is rarely executed, but when it is then (on boxes like
the above) it always fails. Since there are no provisions made for NUMA and
release time is approaching, just do a quick check to avoid acquiring the
lock.

Approved by: re (kib)
sys/vm/vm_glue.c