Page MenuHomeFreeBSD

vm_page: Drop handling of VM_ALLOC_NOOBJ in vm_page_alloc_contig_domain()

Authored by markj on Sep 21 2021, 2:44 AM.



As in vm_page_alloc_domain_after(), unconditionally preserve PG_ZERO.

Implement vm_page_alloc_noobj_contig_domain().

MFC after: never

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

markj requested review of this revision.Sep 21 2021, 2:44 AM

Call vm_page_alloc_check() and vm_page_alloc_dequeue() in the right order.

This revision is now accepted and ready to land.Sep 21 2021, 12:42 PM

Add assertions to exclude all unexpected flags.

This revision now requires review to proceed.Sep 21 2021, 3:14 PM
This revision is now accepted and ready to land.Sep 22 2021, 3:25 PM

Missing a conditional pmap_page_set_memattr() call here.

I'm unclear on whether the conditional pmap_page_set_memattr() call was added.

Update mappings of the returned pages if memattr != VM_MEMATTR_DEFAULT.

This revision now requires review to proceed.Oct 17 2021, 8:50 PM

Since this function only applies to ordinary (DRAM) memory, I would do the zeroing before changing the memattr. Until we return from this function, the pages are not yet being shared with whatever device might have led us to, for example, make the pages uncacheable.

Zero newly allocated pages before updating the direct map.


I'd forgotten that pmap_page_set_memattr() flushes caches, otherwise it would seem incorrect in general to zero the page first. Maybe this deserves a comment.


Yes, this deserves a comment.

markj marked an inline comment as done.

Explain why we zero the page before setting a memory attribute.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 20 2021, 1:23 AM
This revision was automatically updated to reflect the committed changes.