Page MenuHomeFreeBSD

vm_page: define partial page invalidate
ClosedPublic

Authored by dougm on Feb 21 2025, 5:40 PM.
Tags
None
Referenced Files
F122620958: D49096.id151302.diff
Sun, Jul 6, 8:02 PM
Unknown Object (File)
Sat, Jul 5, 10:26 AM
Unknown Object (File)
Fri, Jul 4, 9:58 PM
Unknown Object (File)
Fri, Jul 4, 10:25 AM
Unknown Object (File)
Thu, Jul 3, 6:18 PM
Unknown Object (File)
Thu, Jul 3, 3:01 AM
Unknown Object (File)
Wed, Jul 2, 12:50 AM
Unknown Object (File)
Sun, Jun 29, 6:36 PM

Details

Summary

Two different functions in different files do the same thing - fill a partial page with zeroes. Add that functionality to vm_page.c and remove it elsewhere to avoid code duplication.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Feb 21 2025, 5:40 PM
This revision is now accepted and ready to land.Feb 21 2025, 7:43 PM
sys/vm/vm_page.c
5090

I'd suggest noting that this function may temporarily drop the object lock.

5093

This name is somewhat strange. From the VM's perspective it's not invalidating the page (which normally would involve clearing bits from the page's valid mask), it's just zeroing a region of it. It's the tmpfs and shm objects that are being invalidated.

I'd suggest vm_page_grab_zero_partial() or something like that.

5130

I believe most of this function could be replaced by vm_page_grab_valid(&m, object, pindex, VM_PAGE_ALLOC_WAITOK);

This revision was automatically updated to reflect the committed changes.
dougm marked 2 inline comments as done.

Accept some suggestions from @markj.

sys/vm/vm_page.c
5130

When I recognize that, I'll be happy to make a change to exploit it, but I don't right now.

markj added inline comments.
sys/vm/vm_page.c
5090
5130

Sorry, you're right that it's not quite the right fit.

This revision is now accepted and ready to land.Feb 22 2025, 12:34 AM
This revision was automatically updated to reflect the committed changes.
alc added inline comments.
sys/vm/vm_page.c
5108

This assertion is repeated below.