Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2002 15:04:46 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Alfred Perlstein <alfred@FreeBSD.ORG>, Bosko Milekic <bmilekic@unixdaemons.com>, Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>, current@FreeBSD.ORG, John Baldwin <jhb@FreeBSD.ORG>
Subject:   Re: malloc_bucket() idea (was Re: How to fix malloc.)
Message-ID:  <3C78200E.EC89C4E1@mindspring.com>
References:  <200201051752.g05Hq3gG074525@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> <XFMail.020114020307.jhb@FreeBSD.org> <200201241022.g0OAMISM093913@faber.r.dl.itc.u-tokyo.ac.jp> <20020124024534.V13686@elvis.mu.org> <200202131739.g1DHdZT5023794@rina.r.dl.itc.u-tokyo.ac.jp> <200202190945.g1J9j9kg076110@rina.r.dl.itc.u-tokyo.ac.jp> <200202232051.g1NKpE741310@apollo.backplane.com> <20020223211449.GJ80761@elvis.mu.org> <200202232243.g1NMhZP49110@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Dillon wrote:
>     This is approximately what I am thinking.  Note that this gives us the
>     flexibility to create a larger infrastructure around the bucket cache,
>     such as implement per-cpu caches and so on and so forth.  What I have
>     here is the minimal implementation.

Uh, probably freeing the mutex of the new bucket after holding
the one on the "next" list is probably not what you wanted to
happen.  8-).  I think you would nead a seperate "head", and
then use the head containing structure mutex, instead.

I understand what you were trying to do, though...

I guess you are relying on the use of different buckets to spread
the pain?  Right now the pain is centered arouns one struct type
anyway (the cred one that started this dicussion), so you are still
going to contend the same resource for each (just "bucket hash mtx"
instead of "giant", for the bucket type).  Also, you probably want
it to be a STAILQ.

I'm not sure that this is actually a win?!?  I guess if there are
a bunch of these buckets, you would end up with different hash
values for the mutexes... though relying on a hash seems wrong,
since you can't really control collision domains that way; eventally,
you will get people with widely different perofromance based on
where the linker linked their bucket list head to, and that's
probably not good.

OTOH, A per CPU bucket list means no bucket mtx would be necessary;
without that, it's just replacing one type of contention for another,
I think, until you start making mutex selection indeterminate.  8^(.

Really, this delayed freeing idea is starting to get uglier than
just going to per CPU pools...

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C78200E.EC89C4E1>