migrating proc from zone to objcache

Nicolas Thery nthery at gmail.com
Tue Apr 1 08:29:47 PDT 2008


2008/4/1, Jeffrey Hsu <hsu at dragonflybsd.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
page.

These races could be fixed of course but AFAIU Matt would rather get
rid of zones.

Cheers,
Nicolas





More information about the Kernel mailing list