zdestroy() patch

Nicolas Thery nthery at gmail.com
Sun Jan 20 02:16:42 PST 2008


I know that zalloc() is deprecated but here is anyway a patch that
implements zdestroy() as suggested in:


This patch is not thread-safe and assumes that the mp lock is held
while zalloc() and friends are called as stated in:


I'll commit it in a few days if there are no objections.

Regarding zalloc() lack of thread safety, I see two options:

1/ Modify the man page and comments in vm_zone.c which currently state
the contrary.

2/ Be defensive and add calls to get_mplock() / release_mplock() in
zalloc() and friends.

In any case, the misleading spinlock (zlock) could be removed too.

I've got a preference for (2).  What do you think?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/octet-stream
Size: 8727 bytes
Desc: "Description: Binary data"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20080120/fd37b6c4/attachment-0021.bin>

More information about the Bugs mailing list