Page MenuHomeFreeBSD

Implement pmap_advise() for arm64
ClosedPublic

Authored by alc on Jul 25 2019, 6:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 10:22 AM
Unknown Object (File)
Sun, Dec 1, 12:59 AM
Unknown Object (File)
Nov 22 2024, 5:01 PM
Unknown Object (File)
Nov 19 2024, 10:52 AM
Unknown Object (File)
Nov 19 2024, 9:37 AM
Unknown Object (File)
Nov 19 2024, 9:32 AM
Unknown Object (File)
Nov 18 2024, 3:53 AM
Unknown Object (File)
Nov 18 2024, 1:13 AM
Subscribers

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This is based on the amd64 implementation.

markj added inline comments.
arm64/arm64/pmap.c
4848

Would it be reasonable to handle MADV_WILLNEED by presetting ATTR_AF?

This revision is now accepted and ready to land.Jul 25 2019, 3:36 PM
alc marked an inline comment as done.Jul 25 2019, 10:25 PM
alc added inline comments.
arm64/arm64/pmap.c
4848

Like pmap_protect(), the machine-independent layer only expects this function to remove "things" from the PTE. In other words, it only calls pmap_advise() in these cases.

The machine-independent layer does, however, call pmap_enter_object() for MADV_WILLNEED. We could hypothetically pass a new argument to pmap_enter_object() that says preset the accessed bit (like pmap_enter()) or switch to calling pmap_enter() for MADV_WILLNEED.

4896–4900

By the way, I'm likely to post a patch changing this snippet on amd64, arm64, and i386. This snippet is removing the first 4KB page mapping within the superpage-sized address range. To be clear, the choice of page here is just a heuristic, and not the best heuristic. Removing the last 4KB page mapping produces more repromotions.

alc marked an inline comment as done.Jul 26 2019, 3:34 AM

Here is some data for a "make -j4 buildworld" on a 4-core, 8GB RAM machine.

Without this change:

...
  4250598 pages examined by the page daemon
...
   224966 pages reactivated by the page daemon
...
    40500 page faults requiring I/O
...

With this change:

...
  4207702 pages examined by the page daemon
...
    61162 pages reactivated by the page daemon
...
    30322 page faults requiring I/O
...

Without this change the page daemon's inactive queue scan is going to reactivate most MADV_FREE pages that it processes because they will have ATTR_AF set. We can see the effects of clearing ATTR_AF in the above data, especially, in the number of reactivations.