Date: Sat, 19 Jan 2002 13:10:00 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Julian Elischer <julian@elischer.org> Cc: Alfred Perlstein <bright@mu.org>, smp@FreeBSD.ORG Subject: Re: help with mutex_pool please? Message-ID: <200201192110.g0JLA0J53749@apollo.backplane.com> References: <Pine.BSF.4.21.0201191241060.2065-100000@InterJet.elischer.org>
index | next in thread | previous in thread | raw e-mail
:
:I have another question....
:what will the mutex pool give us as an advantage over other
:techniques.?
It allows you to avoid unnecessary structural bloat in
a number of cases. Mutexes are used in many small
structures (for example see kern_lock.c) where embedding
a full mutex structure can easily double the size of
the original structure. It is possible to reduce
the strucural overhead to 0 with a pool mutex, though
it is more common (and more understandable) if you
embed at least a mutex pointer in the structure.
Their use in kern_lock.c alone justifies the module,
since what we had before was an ad-hoc mutex pool
dedicated to kern_lock.c. Now it's generalized enough
to be useful in a number of other subsystems.
But, please note, I have no intention of allowing these
pool mutexes to be generalized and bloated for use
everywhere. They are strictly intended for leaf-mutex
uses only. A normal mutex should be used for more complex
cases.
-Matt
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201192110.g0JLA0J53749>
