Subject: Re: kernel proplib - pools or malloc?
To: Simon Burge <simonb@wasabisystems.com>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 05/11/2006 17:57:08
Simon Burge wrote:
> Kernel proplib uses pools for storage, which take up at minimum a full
> page if anything is in the pool.  On a walnut, there's 4 populated
> pools and the largest one has just over half a kB of data.
>
> I tried using malloc/free instead of pools on a walnut kernel.
> Booting to the "root device" prompt and then entering ddb and using
> "show uvmexp" gives:
>
> 	Current UVM status (with pools):
> 	  pagesize=16384 (0x4000), pagemask=0x3fff, pageshift=14
> 	  16037 VM pages: 0 active, 0 inactive, 3 wired, 15905 free
> 	  
> 	Current UVM status (with malloc):
> 	  pagesize=16384 (0x4000), pagemask=0x3fff, pageshift=14
> 	  16037 VM pages: 0 active, 0 inactive, 3 wired, 15910 free
>
> So this is saving 80kB of wired kernel memory in this instance.  Worth
> switching over to malloc?
>
> Simon.
> --
> Simon Burge                                   <simonb@wasabisystems.com>
> NetBSD Development, Support and Service:   http://www.wasabisystems.com/
>   

Hmm... right now it seems it attractive, but I wonder if more things are
planned which would increase the amount of stuff we put in properties,
and thus change the analysis somewhat.

I'd suggest that if we change, we make it tunable at least, because we
might want to go back someday soon. :-)

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191