On Sat, Jun 16, 2001 at 03:11:21AM -0400, Alfred Perlstein wrote:
> It would be better if we could allocate/free clusters+mbufs+refcounts
> under a single lock.  It would simplify the API and save a boatload
> of cycles and i-cache by avoiding the mutex operations.
> Not that I object to the current code, I'm just wondering when this
> important optimization is going to be made, or that the interface
> will settle down enough so that I can get started on it.

    Well, as I've mentionned to you previously, I don't think this will
be an optimization. The mb_alloc code already shares the same lock for both
mbufs and clusters and, as for counters, it is not efficient to allocate
them from the mb_alloc allocation routines (due to their extremely small
size, we would consume double the memory to manage them). So what I've
done in mb_alloc is have the counters malloc()ed. However, as I've mentionned,
and as I've already (although quickly) implemented in order to perform testing,
I'm going to change it so that for clusters, the space for the reference counter
will actually be located at the end of the unused portion of the cluster. As
for the other types of buffers, I'll have to sit and think about it some
more but there are obvious solutions that are more optimal than the present
malloc() scheme which I've put in for simplicity purposes.
    In any case, I don't *think* it will be an actual optimization (because the
lists are now per-CPU and there doesn't seem to be a genuine reason for it), but
if, once the dust settles, you can figure out a way to easily implement it
without pessimizing any of the code to do it, then it's certainly worth a shot.
After all, you were right about some of these not-so-obvious things before. :-)
    I think that once we have the new code in, and once I fix the little
malloc() thing, that we should really focus on the remainder of the net code
simply because I want to see Giant get lifted from this area.

> -- 
> -Alfred Perlstein [[EMAIL PROTECTED]]
> Instead of asking why a piece of software is using "1970s technology,"
> start asking why software is ignoring 30 years of accumulated wisdom.

 Bosko Milekic

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to