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)
Wed, Apr 17, 12:48 AM
Unknown Object (File)
Jan 7 2024, 1:55 AM
Unknown Object (File)
Dec 20 2023, 4:51 AM
Unknown Object (File)
Nov 8 2023, 2:41 AM
Unknown Object (File)
Nov 7 2023, 6:44 PM
Unknown Object (File)
Oct 6 2023, 5:39 PM
Unknown Object (File)
Oct 6 2023, 1:38 AM
Unknown Object (File)
Sep 18 2023, 5:56 AM
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