DragonFly kernel List (threaded) for 2008-04
Re: migrating proc from zone to objcache
2008/4/1, Jeffrey Hsu <firstname.lastname@example.org>:
> >> Well, the zone allocator is MP-safe. It's not hard to lock up the places
> >> that manipulate the linked-list of free items. Look for uses of the zlock
> >> field.
> > Well it is documented as MP-safe but it isn't actually and is deprecated:
> > http://leaf.dragonflybsd.org/mailarchive/kernel/2008-01/msg00045.html
> I think you misread that post. The zone allocator itself is MP-safe.
> (Again, look for the zlock spinlock in the zone allocator code to
> see for yourself that it's MP-safe.) The post is refering to the
> subsystems that use the zone allocators as being not MP-safe.
Indeed but the first line of that post also states that none of the VM
s/system is MP safe. As the zone implementation calls into the VM
without explicitly taking the MP lock, it implicitly assumes that its
callers do so.
That being said, I agree that zlock protects the zone data structures
though I wonder about a few cases. For example, what happens if
zget() is called twice concurrently on the same ZONE_INTERRUPT zone?
I reckon we could end up calling twice vm_page_alloc() on the same
These races could be fixed of course but AFAIU Matt would rather get
rid of zones.