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)
Fri, Nov 22, 10:49 PM
Unknown Object (File)
Fri, Nov 22, 10:40 PM
Unknown Object (File)
Nov 12 2024, 8:39 PM
Unknown Object (File)
Nov 6 2024, 6:11 AM
Unknown Object (File)
Nov 4 2024, 10:32 AM
Unknown Object (File)
Oct 14 2024, 2:14 PM
Unknown Object (File)
Oct 2 2024, 3:44 AM
Unknown Object (File)
Sep 16 2024, 2:03 PM
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.