Page MenuHomeFreeBSD

Reduce duplication in grab functions. Make the code more readable.
ClosedPublic

Authored by jeff on Dec 2 2019, 11:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 11, 4:26 PM
Unknown Object (File)
Thu, Jan 9, 1:43 AM
Unknown Object (File)
Nov 23 2024, 12:22 AM
Unknown Object (File)
Nov 17 2024, 5:25 PM
Unknown Object (File)
Oct 29 2024, 10:34 PM
Unknown Object (File)
Oct 16 2024, 11:32 AM
Unknown Object (File)
Oct 7 2024, 8:16 PM
Unknown Object (File)
Oct 7 2024, 8:16 PM
Subscribers

Details

Summary

These functions have become somewhat sprawling. This is partially my fault. Now that we never grab or grab_pages without a busy lock held the same asserts work in both cases. Other than this, I do not intend for there to be any functional differences.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jeff added reviewers: kib, markj, alc, dougm.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/vm/vm_page.c
867 ↗(On Diff #65143)

I renamed this to vm_page_acquire_flags in a different patch since it will also wire the page. I think I like this name better.

I also feel like this file should really be split. Can svn do that while maintaining version history?

This revision is now accepted and ready to land.Dec 3 2019, 3:36 PM
sys/vm/vm_page.c
867 ↗(On Diff #65143)

I believe you can preserve history by doing an svn cp of the file before removing most of its contents.

The file is kind of unwieldy but I also like the fact that basically all logic for manipulating vm_page structures is in one file. How do you propose splitting it?

4430 ↗(On Diff #65143)

It is confusing that we use pflags as allocation flags and allocflags for everything else.

4516 ↗(On Diff #65143)

Why test == 0 when the function returns a bool?

sys/vm/vm_page.c
4430 ↗(On Diff #65143)

It is somewhat confusing but unfortunately necessary. I could also break out the asserts and only compute pflags when calling vm_page_alloc so the visibility is limited.

sys/vm/vm_page.c
867 ↗(On Diff #65143)

I think lookup/grab/busy/wire and allocation could be split. I don't think it's absolutely necessary to do though.

This revision now requires review to proceed.Dec 3 2019, 9:30 PM
This revision is now accepted and ready to land.Dec 4 2019, 5:06 PM