Page MenuHomeFreeBSD

arm64 pmap: Make VM_PAGE_TO_PV_LIST_LOCK() a constant-time operation
ClosedPublic

Authored by alc on May 28 2023, 5:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 26 2024, 3:48 PM
Unknown Object (File)
Jan 14 2024, 9:28 AM
Unknown Object (File)
Dec 20 2023, 5:33 AM
Unknown Object (File)
Dec 4 2023, 12:45 AM
Unknown Object (File)
Oct 26 2023, 11:34 PM
Unknown Object (File)
Sep 21 2023, 12:27 AM
Unknown Object (File)
Sep 3 2023, 1:21 PM
Unknown Object (File)
Aug 25 2023, 2:59 AM
Subscribers

Details

Summary

The prior implementation of VM_PAGE_TO_PV_LIST_LOCK() performed a linear-time search of the vm_phys_segs[] array. However, in contrast to PHYS_TO_PV_LIST_LOCK(), that search is unnecessary because every (non-fictitious) vm_page contains the index of the vm_phys_seg in which it resides.

Change most of the remaining uses of CHANGE_PV_LIST_LOCK_TO_PHYS() and PHYS_TO_PV_LIST_LOCK() to CHANGE_PV_LIST_LOCK_TO_VM_PAGE() and VM_PAGE_TO_PV_LIST_LOCK(), respectively.

Collectively, these changes reduce the size of a GENERIC-NODEBUG kernel's pmap.

Before:

 text   data    bss     dec       hex   filename
70144   3200   2248   75592   0x12748   pmap.o

After:

 text   data    bss     dec       hex   filename
69192   3200   2248   74640   0x12390   pmap.o

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable