HomeFreeBSD

vm: reduce lock contention when processing vm batchqueues

Description

vm: reduce lock contention when processing vm batchqueues

Rather than waiting until the batchqueue is full to acquire the lock &
process the queue, we now start trying to acquire the lock using trylocks
when the batchqueue is 1/2 full. This removes almost all contention on the
vm pagequeue mutex for for our busy sendfile() based web workload.
It also greadly reduces the amount of time a network driver ithread
remains blocked on a mutex, and eliminates some packet drops under
heavy load.

So that the system does not loose the benefit of processing large
batchqueues, I've doubled the size of the batchqueues. This way, when
there is no contention, we process the same batch size as before.

This has been run for several months on a busy Netflix server, as well
as on my personal desktop.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37305

Details

Provenance
gallatinAuthored on Dec 14 2022, 7:34 PM
Reviewer
markj
Differential Revision
D37305: vm: reduce lock contention when processing vm batchqueues
Parents
rGc4a4b2633d97: allocate inpcb aligned to cachelines
Branches
Unknown
Tags
Unknown