Reduce traffic on vm_cnt.v_free_count
authormjg <mjg@FreeBSD.org>
Fri, 13 Oct 2017 21:54:34 +0000 (21:54 +0000)
committermjg <mjg@FreeBSD.org>
Fri, 13 Oct 2017 21:54:34 +0000 (21:54 +0000)
commit03b10745ce0fb10ea3bb26318d269e504137b5de
treec7545e9dc43146fecb47f736cbc586cc28542729
parent2658fd615efd68f820a9c779ea18d44fc174fc8e
Reduce traffic on vm_cnt.v_free_count

The variable is modified with the highly contended page free queue lock.
It unnecessarily shares a cacheline with purely read-only fields and is
re-read after the lock is dropped in the page allocation code making the
hold time longer.

Pad the variable just like the others and store the value as found with
the lock held instead of re-reading.

Provides a modest 1%-ish speed up in concurrent page faults.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D12665
sys/sys/vmmeter.h
sys/vm/vm_page.c
sys/vm/vm_phys.h