Page MenuHomeFreeBSD

vm_page_replace: remove redundant radix lookup
ClosedPublic

Authored by rlibby on Dec 9 2015, 4:30 PM.
Tags
None
Referenced Files
F101908604: D4471.diff
Tue, Nov 5, 11:59 AM
Unknown Object (File)
Wed, Oct 23, 8:25 AM
Unknown Object (File)
Sep 23 2024, 5:12 AM
Unknown Object (File)
Sep 22 2024, 7:08 PM
Unknown Object (File)
Sep 20 2024, 7:45 AM
Unknown Object (File)
Sep 18 2024, 12:24 PM
Unknown Object (File)
Aug 19 2024, 6:42 AM
Unknown Object (File)
Aug 11 2024, 4:18 PM
Subscribers

Details

Summary

Remove redundant lookup of the old page from vm_page_replace.
Verification that the old page exists is already done by
vm_radix_replace.

Follow up from D4326.

Test Plan

kyua test -k /usr/tests/sys/Kyuafile

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1527
Build 1533: arc lint + arc unit

Event Timeline

rlibby retitled this revision from to vm_page_replace: remove redundant radix lookup.
rlibby updated this object.
rlibby edited the test plan for this revision. (Show Details)
kib edited edge metadata.
kib added inline comments.
sys/vm/vm_page.c
1350

This shouldn't matter, since the object is locked, but still I would prefer to have unbusy happens after the old page is removed from the object queue.

This revision is now accepted and ready to land.Dec 9 2015, 4:57 PM
rlibby edited edge metadata.

vm_page_replace: remove from tailq before null'ing object

Restore the original sequence of tailq removal and object NULLing. It
makes sense to operate on the listq while object is not NULL since
listq is supposed to be protected by the object lock of the page.

We are of course still operating without page locks.

This revision now requires review to proceed.Dec 9 2015, 5:01 PM
rlibby added inline comments.
sys/vm/vm_page.c
1350

Yeah, realized the same and made the change.

kib edited edge metadata.
This revision is now accepted and ready to land.Dec 9 2015, 5:26 PM
sys/vm/vm_page.c
1345

How about: "Keep the resident page list in sorted order." That would better explain why we do the replacement this way.

rlibby edited edge metadata.
rlibby marked an inline comment as done.

vm_page_replace: alc feedback: fixup comment

This revision now requires review to proceed.Dec 9 2015, 5:35 PM
rlibby added inline comments.
sys/vm/vm_page.c
1345–1347

Fixed up comment as suggested.

alc edited edge metadata.
In D4471#94059, @rlibby_gmail.com wrote:

vm_page_replace: remove from tailq before null'ing object

Restore the original sequence of tailq removal and object NULLing. It
makes sense to operate on the listq while object is not NULL since
listq is supposed to be protected by the object lock of the page.

We are of course still operating without page locks.

For the current set of callers, the page lock doesn't matter. I'd propose that you develop the patch for vm_fault() next, and I'll think about the page locking in the meantime.

This revision is now accepted and ready to land.Dec 9 2015, 5:51 PM
In D4471#94108, @alc wrote:
In D4471#94059, @rlibby_gmail.com wrote:

We are of course still operating without page locks.

For the current set of callers, the page lock doesn't matter. I'd propose that you develop the patch for vm_fault() next, and I'll think about the page locking in the meantime.

Okay, will do. The patch to vm_fault_hold itself should be pretty straightforward, but it should be gated by our confidence in the correctness of vm_page_replace.

With respect to the page locking, I think we would at least not be introducing any regressions if we make vm_page_replace do what vm_page_insert and vm_page_remove do, which is unlocked for insert, and locked for remove of a managed page.

Incidentally, in vm_page_remove, the xbusy state of the page is handled but not required. And, for what it's worth, internally Isilon has a couple callers of vm_page_replace that are xbusy'ing the page solely to satisfy the interface (related to zero-copy and copy-on-write implementations).

This revision was automatically updated to reflect the committed changes.