Page MenuHomeFreeBSD

Add a return value to vm_page_remove().
ClosedPublic

Authored by markj on Jun 25 2019, 4:02 PM.
Tags
None
Referenced Files
F161851515: D20758.diff
Tue, Jul 7, 10:11 AM
Unknown Object (File)
Sun, Jul 5, 4:53 AM
Unknown Object (File)
Sun, Jul 5, 4:26 AM
Unknown Object (File)
Sat, Jul 4, 8:41 PM
Unknown Object (File)
Sat, Jul 4, 7:18 AM
Unknown Object (File)
Wed, Jul 1, 9:50 PM
Unknown Object (File)
Mon, Jun 22, 4:46 AM
Unknown Object (File)
Fri, Jun 12, 2:24 AM
Subscribers

Details

Summary

This is a small piece of D20486. In that revision we count the object's
reference in the page's ref_count field, and atomically decrement that
reference and check for others.

All callers except for vm_page_free_prep() must provide a page contained
in an object, so move the m->object != NULL check out of
vm_page_remove().

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25036
Build 23750: arc lint + arc unit

Event Timeline

sys/vm/vm_page.c
1485

Before, object could have been NULL, evidently. Here, you depend on it being not NULL. Can you assert that somewhere?

sys/vm/vm_page.c
1485

In general we don't add assertions for conditions which will unconditionally crash the kernel anyway. In particular, the VM_OBJECT_ASSERT_WLOCKED() above effectively provides the same assertion.

This revision is now accepted and ready to land.Jun 25 2019, 4:52 PM
This revision was automatically updated to reflect the committed changes.