Page MenuHomeFreeBSD

powerpc64/pmap: Simplify the code path for moea64_pte_replace_native()
ClosedPublic

Authored by jhibbits on Sep 4 2019, 3:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 11:30 PM
Unknown Object (File)
Feb 4 2024, 2:16 PM
Unknown Object (File)
Dec 20 2023, 4:30 AM
Unknown Object (File)
Nov 18 2023, 11:56 AM
Unknown Object (File)
Nov 10 2023, 9:47 AM
Unknown Object (File)
Nov 8 2023, 9:44 AM
Unknown Object (File)
Nov 7 2023, 12:17 PM
Unknown Object (File)
Oct 7 2023, 8:42 AM
Subscribers

Details

Summary

MOEA64_PTE_REPLACE() is called often with the pmap lock held, and
sometimes with the page pv lock held. The less work done while holding
a lock, the better. Since we are intending to replace the same PTE
(same hash index), we don't need to recalculate anything, just flat
replace the PTE. This cuts more than 200 instructions off the
invalidating code path. In addition, we don't need to replace a PTE
that's not occupied by this PVO.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 26283
Build 24765: arc lint + arc unit

Event Timeline

I'm not that familiar with this code, but overall the change looks good and seem to preserve the behavior of previous version, except for the part in the following comment.

sys/powerpc/aim/moea64_native.c
396–397

This doesn't look correct.
In the old code moea64_pte_unset_native() would decrement moea64_pte_valid and moea64_pte_insert_native() would increment it again.
In this case, these two lines should be removed.

402

It seems pt assignment can be moved to the if (flags == 0) { } block, to save a few more cycles.

Address luporl's comments.

This revision is now accepted and ready to land.Sep 5 2019, 1:14 PM