Page MenuHomeFreeBSD

Remove most of the now unused code for implementing PG_CACHED pages.
ClosedPublic

Authored by alc on Nov 11 2016, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 2:30 PM
Unknown Object (File)
Fri, Mar 29, 2:13 PM
Unknown Object (File)
Fri, Mar 29, 11:18 AM
Unknown Object (File)
Thu, Mar 28, 8:44 AM
Unknown Object (File)
Mar 8 2024, 1:13 AM
Unknown Object (File)
Mar 7 2024, 11:04 PM
Unknown Object (File)
Feb 27 2024, 11:13 PM
Unknown Object (File)
Jan 30 2024, 8:26 AM
Subscribers

Details

Summary

This revision removes most of the code for implementing PG_CACHED pages. It does not remove user-space visible fields from vm_cnt or all of the references to cached pages from comments. Those changes will come later.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

alc retitled this revision from to Remove most of the now unused code for implementing PG_CACHED pages..
alc updated this object.
alc edited the test plan for this revision. (Show Details)
alc added reviewers: kib, markj.
alc added a subscriber: pho.
kib edited edge metadata.
kib added inline comments.
vm/vm_page.c
1786

The description 'initialize' is somewhat weird for the remnants of this function. It only manages bookkeeping for the phys allocator, effectively.

This revision is now accepted and ready to land.Nov 11 2016, 6:28 PM

There are some callers of vm_page_alloc() that can be simplified a bit. For instance, shm_dotruncate() no longer needs to check the valid bits of the page returned by vm_page_alloc(). I believe the valid bit check in vm_page_grab() can be removed as well.

vm/vm_page.c
1786

I'd like to propose some refactoring: Move the vm_phys_freecnt_adj() back to the callers, leaving only the KASSERT()s in this function. (This is actually an optimization for vm_page_alloc_contig().) Rename the function to vm_page_alloc_check(), and move the calls to a point after the free queue lock is released.

alc edited edge metadata.

Refactor (and rename) vm_page_alloc_init().

This revision now requires review to proceed.Nov 12 2016, 8:54 AM
kib edited edge metadata.

I alike the update, and agree with it.

This revision is now accepted and ready to land.Nov 12 2016, 1:09 PM
In D8497#176612, @markj wrote:

There are some callers of vm_page_alloc() that can be simplified a bit. For instance, shm_dotruncate() no longer needs to check the valid bits of the page returned by vm_page_alloc(). I believe the valid bit check in vm_page_grab() can be removed as well.

Yes, and also vm_fault(). Today, I'm going to review all of the callers to vm_page_alloc() and update them where appropriate. I expect that to be the final change to this patch.

alc edited edge metadata.

Simplify callers to vm_page_alloc().

This revision now requires review to proceed.Nov 12 2016, 5:48 PM
markj edited edge metadata.
This revision is now accepted and ready to land.Nov 12 2016, 5:49 PM

Peter, could you please run this patch through your regular battery of tests?

fs/tmpfs/tmpfs_subr.c
1375 ↗(On Diff #22174)

Having vm_pager_get_pages() in the else block is not very useful: the previous then block ends in goto. Moving it out of else block reduces indent.

kern/uipc_shm.c
458 ↗(On Diff #22174)

Same there.

In D8497#176808, @alc wrote:

Peter, could you please run this patch through your regular battery of tests?

Sure.

alc edited edge metadata.

Style only changes to tmpfs_subr.c and uipc_shm.c.

This revision now requires review to proceed.Nov 12 2016, 6:11 PM
alc marked 2 inline comments as done.Nov 12 2016, 6:12 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Nov 12 2016, 6:25 PM
In D8497#176808, @alc wrote:

Peter, could you please run this patch through your regular battery of tests?

I ran all of the tests I have and found no problems.

This revision was automatically updated to reflect the committed changes.