Page MenuHomeFreeBSD

Convert consumers to vm_page_alloc_noobj_contig()
ClosedPublic

Authored by markj on Sep 17 2021, 2:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 10:11 AM
Unknown Object (File)
Mon, Mar 11, 1:16 AM
Unknown Object (File)
Mon, Mar 4, 4:13 AM
Unknown Object (File)
Mon, Mar 4, 4:13 AM
Unknown Object (File)
Mon, Mar 4, 4:13 AM
Unknown Object (File)
Mon, Mar 4, 4:12 AM
Unknown Object (File)
Sun, Mar 3, 1:29 AM
Unknown Object (File)
Sun, Mar 3, 1:29 AM

Details

Summary

Remove now-unneeded page zeroing. No functional change intended.

Diff Detail

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

Event Timeline

markj requested review of this revision.Sep 17 2021, 2:17 PM
hselasky added a subscriber: hselasky.

Looks good, assuming zero handling is preserved.

This revision is now accepted and ready to land.Sep 17 2021, 2:30 PM
sys/amd64/amd64/mp_machdep.c
337

I observe that you eliminated VM_ALLOC_NOBUSY here but not elsewhere. Why?

sys/amd64/amd64/mp_machdep.c
337

No good reason. I think it makes sense to simply drop the VM_ALLOC_NOBUSY flag from all callers, as it is already implied by VM_ALLOC_NOOBJ.

sys/amd64/amd64/mp_machdep.c
337

I agree.

Drop unused VM_ALLOC_NOBUSY from consumers.

This revision now requires review to proceed.Sep 17 2021, 7:08 PM

Drop uses of VM_ALLOC_NORMAL from vm_page_alloc_noobj_contig() and
vm_page_alloc_noobj_contig_domain() callers.

kib added inline comments.
sys/arm/nvidia/drm2/tegra_bo.c
106

The variable becomes somewhat pointless. You can directly pass _WIRED|_ALLOC_ZERO to vm_page_alloc_noobj_contig(), and vm_page_reclaim_contig() is fine with 0 instead pflags.

This revision is now accepted and ready to land.Oct 4 2021, 1:47 AM
markj marked an inline comment as done.

Drop an unneeded local variable.

This revision now requires review to proceed.Oct 4 2021, 1:59 AM
alc added inline comments.
sys/compat/linuxkpi/common/src/linux_page.c
107–109

Is PAGE_SIZE actually correct? I would guess that Linux guarantees that an order n allocation is aligned to an order n address. That said, at the moment, this is probably not an issue because of the way that vm_phys does contig allocations.

sys/powerpc/aim/mmu_radix.c
3582

Does VM_ALLOC_ZERO actually make sense here?

This revision is now accepted and ready to land.Oct 17 2021, 1:04 AM
sys/powerpc/aim/mmu_radix.c
3582

It doesn't seem so. I think both of these XXX comments can be resolved by ORing malloc2vm_flags(flags) into req.

sys/compat/linuxkpi/common/src/linux_page.c
107–109

I can't find any Linux documentation or code that definitively answers this. Looking at the alloc_pages() implementation, it does seem to return self-aligned runs in practice, but I can't tell if this is a guarantee of the interface. alloc_contig_pages() has a comment stating that self-alignment is guaranteed if the size of the run is a power of 2, but this function is not used much.

Use malloc2vm_flags() in radix_pgd_import().

This revision now requires review to proceed.Oct 17 2021, 9:15 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 27 2021, 3:00 PM
This revision was automatically updated to reflect the committed changes.