Page MenuHomeFreeBSD

Place VM objects on the object list when created and never remove them.
ClosedPublic

Authored by jhb on May 1 2015, 5:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 9:04 PM
Unknown Object (File)
Nov 21 2023, 9:58 AM
Unknown Object (File)
Nov 20 2023, 2:06 AM
Unknown Object (File)
Nov 9 2023, 9:31 PM
Unknown Object (File)
Nov 9 2023, 8:45 AM
Unknown Object (File)
Oct 14 2023, 1:01 AM
Unknown Object (File)
Oct 8 2023, 8:27 PM
Unknown Object (File)
Oct 8 2023, 7:34 AM
Subscribers

Details

Summary

This is ok since objects come from a NOFREE zone and allows objects to
be locked while traversing the object list without triggering a LOR.

Ensure that objects on the list are marked DEAD while free or stillborn,
and that they have a refcount of zero.

Test Plan
  • booted a kernel with INVARIANTS and WITNESS

Diff Detail

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

Event Timeline

jhb retitled this revision from to Place VM objects on the object list when created and never remove them..
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: alc, kib.
jhb updated this object.
kib edited edge metadata.
This revision is now accepted and ready to land.May 1 2015, 5:30 PM
sys/vm/vm_object.c
191 ↗(On Diff #5140)

I don't think that it is correct to remove this because of:

obj_zone = uma_zcreate("VM OBJECT", sizeof (struct vm_object), NULL,

#ifdef INVARIANTS

vm_object_zdtor,

#else

NULL,

#endif

vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
191 ↗(On Diff #5140)

I would suggest KASSERT()ing this here and moving the actual assignment to the backing object scan below.

1802 ↗(On Diff #5140)

Add:
backing_object->type = OBJT_DEAD;

Ok. I had actually meant to enable the zone dtor unconditionally (oops), but I'm fine with fixing it as you suggest instead.

Hmm, one other note is that most objects that are destroyed when the ref count drops to zero do not set OBJT_DEAD in their pager's dealloc routine. In fact, only the vnode pager seems to do this, so I think I will need to explicitly set OBJT_DEAD in vm_object_deallocate(). I should perhaps clear the handle to NULL as well?

Ya, you're right. Add the OBJT_DEAD assignment to the other pagers so that we're handling this in a uniform way.

jhb edited edge metadata.
  • Restore the zdtor to INVARIANTS only and set OBJT_DEAD in callers.
  • Clear object handle and set type to DEAD in all pagers.
  • Move the KASSERT to check for credentials before clearing object type.
This revision now requires review to proceed.May 6 2015, 7:41 PM
alc edited edge metadata.
This revision is now accepted and ready to land.May 8 2015, 3:34 PM
This revision was automatically updated to reflect the committed changes.