Page MenuHomeFreeBSD

Reduce traffic on vm_cnt.v_free_count
ClosedPublic

Authored by mjg on Oct 13 2017, 7:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 23, 11:39 PM
Unknown Object (File)
Sun, Feb 23, 2:29 PM
Unknown Object (File)
Fri, Feb 21, 8:39 PM
Unknown Object (File)
Fri, Feb 21, 2:58 PM
Unknown Object (File)
Jan 22 2025, 12:52 PM
Unknown Object (File)
Jan 22 2025, 8:10 AM
Unknown Object (File)
Jan 21 2025, 9:35 PM
Unknown Object (File)
Jan 21 2025, 10:48 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Oct 13 2017, 8:09 PM
This revision was automatically updated to reflect the committed changes.
head/sys/sys/vmmeter.h
143

The lock annotation should still be "(f)".