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)
Thu, Nov 7, 11:28 PM
Unknown Object (File)
Sep 26 2024, 8:10 AM
Unknown Object (File)
Sep 25 2024, 3:42 PM
Unknown Object (File)
Sep 22 2024, 12:00 AM
Unknown Object (File)
Sep 20 2024, 9:04 PM
Unknown Object (File)
Sep 3 2024, 3:09 AM
Unknown Object (File)
Aug 16 2024, 2:35 PM
Unknown Object (File)
Jul 16 2024, 8:11 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.