Page MenuHomeFreeBSD

amd64: Add comments to pmap_pinit_type()
ClosedPublic

Authored by markj on Oct 16 2021, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 28, 11:03 PM
Unknown Object (File)
Thu, Mar 26, 3:08 PM
Unknown Object (File)
Wed, Mar 25, 8:21 PM
Unknown Object (File)
Sat, Mar 21, 1:39 PM
Unknown Object (File)
Thu, Mar 5, 6:57 PM
Unknown Object (File)
Feb 25 2026, 11:05 PM
Unknown Object (File)
Feb 8 2026, 2:29 PM
Unknown Object (File)
Feb 7 2026, 11:10 PM
Subscribers

Details

Summary

... explaining why we don't pass the pmap pointer to
pmap_alloc_pt_page().

Reported by: alc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42177
Build 39065: arc lint + arc unit

Event Timeline

Update the comment to mention the real reason for not counting
the root page(s).

I think it is fine for now, but ultimately I would probably work on accounting root page table pages and fixing pmap_remove() to check for number of root pages instead of zero. This should be relatively simple.

This revision is now accepted and ready to land.Oct 17 2021, 9:22 PM

I strongly suspect that the introduction of kern_exec.c's shared page in every address space rendered pmap_remove()'s early termination optimization completely ineffective. (Keep in mind that the shared page belongs to an OBJT_PHYS object, so the shared page has an unmanaged mapping.)

Once upon a time, almost all user address spaces would have consisted of nothing but managed mappings. And, when terminating a user address space, pmap_remove_pages() would have destroyed all of those mappings before any calls to pmap_remove() occurred from vm_map_delete(). In other words, the pmap's resident count would have been zero before any of those calls to pmap_remove(), so they would have terminated before even acquiring the pmap lock. Now, the shared page mapping stops that.

I will work on the accounting patch after this one lands.

This revision was automatically updated to reflect the committed changes.