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
F148179776: D20758.diff
Mon, Mar 16, 7:36 AM
F148151709: D20758.diff
Mon, Mar 16, 2:42 AM
Unknown Object (File)
Sat, Mar 14, 4:25 PM
Unknown Object (File)
Sat, Mar 14, 3:26 PM
Unknown Object (File)
Tue, Mar 10, 2:48 PM
Unknown Object (File)
Sun, Mar 1, 11:28 PM
Unknown Object (File)
Sun, Mar 1, 1:58 PM
Unknown Object (File)
Sun, Mar 1, 2:15 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/vm/vm_page.c
1485 ↗(On Diff #59010)

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 ↗(On Diff #59010)

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.