From owner-freebsd-hackers Thu Aug 24 19:17:21 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id TAA17204 for hackers-outgoing; Thu, 24 Aug 1995 19:17:21 -0700 Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id TAA17197 for ; Thu, 24 Aug 1995 19:17:17 -0700 Received: from corbin.Root.COM (corbin [198.145.90.34]) by Root.COM (8.6.11/8.6.5) with ESMTP id TAA10279; Thu, 24 Aug 1995 19:16:16 -0700 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.11/8.6.5) with SMTP id TAA13550; Thu, 24 Aug 1995 19:18:10 -0700 Message-Id: <199508250218.TAA13550@corbin.Root.COM> To: terry@cs.weber.edu (Terry Lambert) cc: hackers@freebsd.org Subject: Re: sys/malloc.h In-reply-to: Your message of "Thu, 24 Aug 95 20:09:44 MDT." <9508250209.AA09902@cs.weber.edu> From: David Greenman Reply-To: davidg@Root.COM Date: Thu, 24 Aug 1995 19:18:10 -0700 Sender: hackers-owner@freebsd.org Precedence: bulk >> The KMEMSTATS #ifdefs are bogus and should be removed. I had removed them >> once in my local sources but the changes got lost. We always gather malloc >> stats in FreeBSD - the information is just too important to be without. > >In which case the MALLOC()/free() parings are incorrect, and should be >using MALLOC()/FREE() instead, right? Or malloc()/free(). > >It doesn't seem legal to mix pairings. MALLOC/FREE are bogus and should be removed. >On the other hand, the spl() code still seems ...bizarre. The spl() is >being set twice, once in the malloc()/free() and once on the macroized >versions. The stats are collected in malloc/free, not in the macroized versions. >Seems that maybe the stats gathering should be moved into malloc()/free() >itself instead of being in malloc.h to save at least one spl/splx pair. The extra spls are never executed since KMEMSTATS is always true. >We may even want to reconsider why spl/splx is needed to guard around >the malloc()/free() anyway -- obviously to allow allocation/freeing >in interrupt code. Perhaps we should adopt an architecture of prealloc >and free later for interrupt level alloc/free? It's because mallocs and frees have to happen in the networking code at interrupt time. It would be tremendously wasteful to pre-alloc megabytes of memory just to avoid this. -DG