Page MenuHomeFreeBSD

Implement reclaim_pv_chunk on arm64
ClosedPublic

Authored by andrew on May 2 2017, 4:31 PM.
Tags
None
Referenced Files
F93721745: D10574.diff
Wed, Sep 11, 10:43 PM
Unknown Object (File)
Sun, Aug 18, 4:25 AM
Unknown Object (File)
Jul 4 2024, 6:24 PM
Unknown Object (File)
Jun 21 2024, 11:02 PM
Unknown Object (File)
Jun 18 2024, 7:08 PM
Unknown Object (File)
May 21 2024, 12:59 PM
Unknown Object (File)
May 9 2024, 7:03 PM
Unknown Object (File)
May 9 2024, 6:49 PM
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

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

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 ↗(On Diff #27933)

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 ↗(On Diff #27933)

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
1970 ↗(On Diff #28019)

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.