Page MenuHomeFreeBSD

vm_page_replace: add wrapper to KASSERT about old page
ClosedPublic

Authored by rlibby on Dec 11 2015, 8:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 4:54 AM
Unknown Object (File)
Mon, Dec 2, 2:59 AM
Unknown Object (File)
Wed, Nov 27, 2:54 AM
Unknown Object (File)
Nov 22 2024, 6:48 AM
Unknown Object (File)
Nov 22 2024, 1:02 AM
Unknown Object (File)
Nov 22 2024, 12:03 AM
Unknown Object (File)
Nov 21 2024, 11:31 PM
Unknown Object (File)
Nov 18 2024, 11:25 PM
Subscribers

Details

Summary

It turns out the callers of vm_page_replace know exactly which page they
are replacing and would like to assert about it. Change those from hard
panics to KASSERTs, and provide them with a wrapper so they don't have
to deal with warnings from an INVARIANTS-dependent dead store of the
return value of vm_page_replace.

Preliminary work for D4478.

I'm definitely open to suggestions for renaming the wrapper and
vm_page_replace if you have any ideas.

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 1569
Build 1575: arc lint + arc unit

Event Timeline

rlibby retitled this revision from to vm_page_replace: add wrapper to KASSERT about old page.
rlibby updated this object.
rlibby edited the test plan for this revision. (Show Details)
rlibby added reviewers: alc, kib.
kib edited edge metadata.

Traditionally we used names like XXX_locked(), might be name it vm_page_replace_checked(). IMO the _check/checked suffix is telling enough.

This revision is now accepted and ready to land.Dec 11 2015, 12:39 PM
rlibby edited edge metadata.

vm_page_replace: kib feedback: s/check/checked/

This revision now requires review to proceed.Dec 11 2015, 4:47 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Dec 11 2015, 4:52 PM
cem added inline comments.
sys/vm/sg_pager.c
190–193

sg_pager_getpages has been rototilled out from underneath this patch, needs rebasing before I can apply it.

rlibby edited edge metadata.

Rebase, resolving conflict.

Resolution was trivial, I don't think this needs re-review, but I'm
unsure if there's some kind of policy for that.

I am having environment issues so I build-tested the fix up but didn't
run any tests.

This revision now requires review to proceed.Dec 17 2015, 11:06 AM
alc edited edge metadata.
This revision is now accepted and ready to land.Dec 17 2015, 5:27 PM
This revision was automatically updated to reflect the committed changes.