Page MenuHomeFreeBSD

Implement reclaim_pv_chunk on arm64
ClosedPublic

Authored by andrew on May 2 2017, 4:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 6:59 AM
Unknown Object (File)
Tue, Oct 29, 8:27 AM
Unknown Object (File)
Sep 29 2024, 10:20 PM
Unknown Object (File)
Sep 27 2024, 11:09 AM
Unknown Object (File)
Sep 27 2024, 11:06 AM
Unknown Object (File)
Sep 25 2024, 7:22 AM
Unknown Object (File)
Sep 25 2024, 3:24 AM
Unknown Object (File)
Sep 23 2024, 12:17 AM
Subscribers

Details

Summary

Add reclaim_pv_chunk on arm64. This is based on the amd64 code so should
operate similarly, other than not needing the delayed invalidation.

It has been tested with artificial injection of vm_page_alloc failures.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9024
Build 9429: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.May 2 2017, 5:34 PM

Calling pmap_invalidate_page() on each destroyed mapping makes the pmap_invalidate_all() calls redundant. In case you ever want to duplicate the batching that is performed on amd64, I would suggest commenting out the pmap_invalidate_all() calls with a few words in the comment about the pmap_invalidate_page() calls.

Further testing has found a few bugs in the code.

The main one I'm hitting is the pmap_pv_demote_l2: pv not found KASSERT when I run sort /dev/zero with vm_page_alloc being skipped 0.1% of the time falling into reclaim_pv_chunk (via a fail point).

sys/arm64/arm64/pmap.c
1906

Is this actually correct? You want to continue if this is a superpage mapping and fall through if it is a 4KB page mapping.

sys/arm64/arm64/pmap.c
1906

I think the error is line 1905, it should be pmap_pde. I later perform the l2 to l3 to get the pte, however we need the pde to pass to pmap_unuse_l3.

andrew edited edge metadata.

Clean up and bug fixes based on reviews and testing:

  • Remove an unneeded pmap_invalidate_all
  • Add a missed PTE_SYNC
  • Correctly call pmap_pde
  • Use the correct value in pmap_l2_to_l3
  • Use pmap_load

This is stable now. While failing 1% of vm_page_alloc calls in get_pv_entry
I can sort /dev/zero and boot to multiuser mode without a panic.

This revision now requires review to proceed.May 4 2017, 1:25 PM
sys/arm64/arm64/pmap.c
1968

This invalidate is also redundant.

Remove another unneeded pmap_invalidate_all

This revision is now accepted and ready to land.May 4 2017, 5:07 PM
This revision was automatically updated to reflect the committed changes.