From owner-freebsd-arch Wed Apr 10 2:18:57 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by hub.freebsd.org (Postfix) with ESMTP id F19B437B41C for ; Wed, 10 Apr 2002 02:18:51 -0700 (PDT) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id g3A9Iio01898; Wed, 10 Apr 2002 05:18:44 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Wed, 10 Apr 2002 05:18:44 -0400 (EDT) From: Jeff Roberson To: Wes Peters Cc: Dag-Erling Smorgrav , Subject: Re: Removing limits from malloc(9) In-Reply-To: <3CB37FAF.DE67363E@softweyr.com> Message-ID: <20020410051245.A87494-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 9 Apr 2002, Wes Peters wrote: > Dag-Erling Smorgrav wrote: > > > > It's still a lot better than Giant, and it's a leaf lock so there > > shouldn't be any worries about reversal. I'd go for it if I were you. > > Can they be updated with an atomic increment? For statistics like this, > being off by 1 or 2 on read isn't so important as long as you don't miss > a bunch of counts. > An atomic increment would still cause cache thrashing. I considered doing per cpu queues for the statistics and then aggregating them when someone wants to report them. This doesn't work if you want to do limits though, since you'd need to check all of the statistics caches at each call. I suppose that this is really good enough at this point. Maybe when we're running on 64 or 128 CPU systems the cache thrashing will hurt enough to get rid of limits. :-) Until then I'll just leave them the way they are and wrap the whole thing in a per malloc_type mutex. This should sufficiently reduce contention and make malloc(9) totally mp safe. Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message