Page MenuHomeFreeBSD

pmap_copy: Clear the accessed bit when copying a managed superpage mapping
ClosedPublic

Authored by alc on Jul 13 2021, 7:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 4:34 PM
Unknown Object (File)
Tue, Apr 30, 11:07 AM
Unknown Object (File)
Mar 26 2024, 12:51 PM
Unknown Object (File)
Mar 19 2024, 9:14 PM
Unknown Object (File)
Dec 22 2023, 11:52 PM
Unknown Object (File)
Dec 12 2023, 2:35 PM
Unknown Object (File)
Dec 5 2023, 6:50 PM
Unknown Object (File)
Nov 28 2023, 9:03 PM
Subscribers

Details

Summary

pmap_copy() is used to speculatively create mappings, so those mappings should not have their access bit preset.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alc requested review of this revision.Jul 13 2021, 7:11 AM

The demotion code does not require superpage mappings to have their accessed bit set, so there is no reason not to clear it in pmap_copy().

In D31162#701247, @alc wrote:

The demotion code does not require superpage mappings to have their accessed bit set, so there is no reason not to clear it in pmap_copy().

Please add this sentence to the comment.

sys/amd64/amd64/pmap.c
7792

Why do you limit clearing to PG_MANAGED mappings?

alc marked an inline comment as done.Jul 14 2021, 5:52 AM
alc added inline comments.
sys/amd64/amd64/pmap.c
7792

We never actually test the accessed bit state on unmanaged mappings. We don't really care whether it represents the page having been accessed. So, typically, we preset the accessed bit on unmanaged mappings to eliminate the future cost of atomically setting it. Since most arm64 cores still use a software exception handler to set the accessed bit, presetting the accessed bit for unmanaged mappings arguably makes more sense on arm64 than it ever did on x86.

This revision is now accepted and ready to land.Jul 14 2021, 7:16 AM
This revision was automatically updated to reflect the committed changes.
alc marked an inline comment as done.