Page MenuHomeFreeBSD

factor common code out of vm_page_alloc*contig_domain
ClosedPublic

Authored by dougm on Dec 18 2021, 9:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 27 2024, 12:08 PM
Unknown Object (File)
Feb 13 2024, 4:52 AM
Unknown Object (File)
Jan 1 2024, 8:13 AM
Unknown Object (File)
Dec 20 2023, 1:21 AM
Unknown Object (File)
Nov 25 2023, 8:39 AM
Unknown Object (File)
Oct 13 2023, 11:17 PM
Unknown Object (File)
Sep 1 2023, 4:55 AM
Unknown Object (File)
Aug 10 2023, 3:40 AM
Subscribers

Details

Summary

Besides reducing code duplication, for the object case this avoids needlessly executing some code when a reservation is broken to release pages.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Dec 18 2021, 9:54 AM
dougm created this revision.

This change does slightly reduce the code size:
dougm@108-254-203-204:GENERIC $ size orig.vm_page.o

 text    data     bss     dec       hex   filename
50782   25808   13424   90014   0x15f9e   orig.vm_page.o

dougm@108-254-203-204:GENERIC $ size vm_page.o

 text    data     bss     dec       hex   filename
50670   25808   13424   89902   0x15f2e   vm_page.o
sys/vm/vm_page.c
2195

This partial sentence should be reformulated now, I believe. Out of old context it is not sufficient, and should be a normal sentence.

2208

Now in vm_page_alloc_contig_domain(), this would loop without retrying vm_reserv_alloc_contig(). Was it intended? From the commit message it seems so, but vm_domain_alloc_fail() drops object lock which might change the disposition for reservations?

dougm marked 2 inline comments as done.

Improve comments.

This revision is now accepted and ready to land.Dec 24 2021, 1:43 AM
sys/vm/vm_page.c
2208

It was intended. Now, if vm_reserv_reclaim_contig returns true, control goes to vm_reserv_object && vm_reserv_alloc_contig without a call to vm_domain_alloc_fail, so the object lock would not have been dropped, and the vm_reserv_alloc_contig call will fail a second time.