Page MenuHomeFreeBSD

vnode_pager: use ptoa(), atop()
ClosedPublic

Authored by dougm on Mar 12 2025, 6:07 PM.
Tags
None
Referenced Files
F142423794: D49330.diff
Mon, Jan 19, 8:35 PM
Unknown Object (File)
Fri, Jan 16, 8:19 PM
Unknown Object (File)
Wed, Jan 14, 11:48 AM
Unknown Object (File)
Wed, Jan 14, 11:42 AM
Unknown Object (File)
Sat, Jan 10, 3:44 PM
Unknown Object (File)
Tue, Jan 6, 4:34 PM
Unknown Object (File)
Fri, Jan 2, 8:20 PM
Unknown Object (File)
Wed, Dec 31, 9:40 AM
Subscribers

Details

Summary

Use ptoa() or atop() instead of arithmetic with PAGE_SIZE or PAGE_SHIFT.

Diff Detail

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

Event Timeline

dougm requested review of this revision.Mar 12 2025, 6:07 PM
dougm created this revision.
alc added reviewers: kib, markj.
This revision is now accepted and ready to land.Sun, Dec 21, 8:45 PM
dougm retitled this revision from vnode_pager: use ptoa() to vnode_pager: use ptoa(), atop().
dougm edited the summary of this revision. (Show Details)

Since this was first posted for review, changes have made some parts redundant, and other parts incomplete. The patch can no longer be applied to main. Update it to use atop() in more places, and to simplify loops in one function.

This revision now requires review to proceed.Sun, Dec 21, 10:51 PM
sys/vm/vnode_pager.c
1538

To do ptoa/atop only once?

1575

Could this line be unsplit now due to de-indent?

1578

Again, could you replace ptoa() on each iteration by single atop()?

sys/vm/vnode_pager.c
1526

I would separate these changes to vnode_pager_undirty_pages() from the rest, which are purely mechanical.

This revision is now accepted and ready to land.Mon, Dec 22, 11:12 PM
This revision was automatically updated to reflect the committed changes.