Implement a simple heuristic to skip pointless promotion attempts by
pmap_enter_quick_locked(). Specifically, when vm_fault() calls
pmap_enter_quick() to map neighboring pages at the end of a copy-on-
write fault, there is no point in attempting promotion in
pmap_enter_quick_locked(). Promotion will fail because the pages
have differing protection settings. The key change here is to pass
the same protection setting to pmap_enter_quick() that was previously
passed to pmap_enter(), so that pmap_enter_quick() can know whether
pmap_enter() created a mapping that allows write access.
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/vm/vm_fault.c | ||
---|---|---|
1956 | Should setting of VM_PROT_NO_PROMOTE occur there and not in pmap_enter_quick? Right now it does not matter because pmap_enter_quick() is only called from there. |
sys/vm/vm_fault.c | ||
---|---|---|
1956 | I didn't want to pass unexpected arguments to other pmap implementations. For the most part, other pmap implementations don't attempt promotion from pmap_enter_quick(), so the new argument is moot. Only mmu_oea64 might promote from pmap_enter_quick(), so I've implemented support for the flag there. |
From a (very) quick check, it looks like the same change in amd64 should be made to mmu_radix for powerpc.
Got it, thanks! I had just searched for a similar comment to what I saw in the amd64, and didn't go any further than that, but obviously I should have.
@jhibbits I would encourage you to apply https://reviews.freebsd.org/D40478 and a few other superpage-related follow on commits from amd64 to mmu_radix.c. This change would then apply to mmu_radix.c.