Page MenuHomeFreeBSD

Optimize reserve_pv_entries() in sys/amd64/amd64/pmap.c
ClosedPublic

Authored by jkim on May 24 2016, 7:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 3:42 AM
Unknown Object (File)
Dec 20 2023, 2:16 AM
Unknown Object (File)
Nov 11 2023, 11:14 AM
Unknown Object (File)
Nov 10 2023, 11:09 AM
Unknown Object (File)
Nov 9 2023, 11:17 AM
Unknown Object (File)
Oct 30 2023, 9:57 PM
Unknown Object (File)
Oct 19 2023, 10:54 PM
Unknown Object (File)
Oct 9 2023, 10:07 AM
Subscribers

Details

Summary

As alc pointed out, Clang does not generate optimal popcnt_pc_map_elem_pq().

http://docs.freebsd.org/cgi/mid.cgi?552BFEB2.8040407

I tried many implementations but I was not able to generate optimal code for both Clang and GCC. This patch just implements it in inline assembly without loop or unrolled loop. Also, newly added bit_count() is used instead of bitcount64() for the non-POPCNT case.

Diff Detail

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

Event Timeline

jkim retitled this revision from to Optimize reserve_pv_entries() in sys/amd64/amd64/pmap.c.
jkim updated this object.
jkim edited the test plan for this revision. (Show Details)
jkim added reviewers: alc, jhb, kib.
jkim set the repository for this revision to rS FreeBSD src repository - subversion.
kib edited edge metadata.
This revision is now accepted and ready to land.May 24 2016, 8:09 PM
sys/amd64/amd64/pmap.c
3150 ↗(On Diff #16815)

Since this function assumes a certain map size, I'd suggest adding a CTASSERT to that effect, so that a map size change would be detected at compile time.

alc edited edge metadata.

There is already a CTASSERT elsewhere.

This revision was automatically updated to reflect the committed changes.