Page MenuHomeFreeBSD

vnode_pager: use ptoa(), atop()
ClosedPublic

Authored by dougm on Mar 12 2025, 6:07 PM.
Tags
None
Referenced Files
F142738884: D49330.id152183.diff
Thu, Jan 22, 10:47 PM
F142738567: D49330.id168551.diff
Thu, Jan 22, 10:42 PM
Unknown Object (File)
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
Subscribers

Details

Summary

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

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

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.Dec 21 2025, 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.Dec 21 2025, 10:51 PM
sys/vm/vnode_pager.c
1528

To do ptoa/atop only once?

1546

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

1559

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.Dec 22 2025, 11:12 PM
This revision was automatically updated to reflect the committed changes.