pahole - Finding holes in kernel structs

Robert Watson rwatson at FreeBSD.org
Thu Feb 12 09:52:10 PST 2009


On Thu, 12 Feb 2009, Ed Schouten wrote:

> * Max Laier <max at love2party.net> wrote:
>> So to answer your first question, submitting 101 patches to rearrange 101
>> structs is certainly a wasted effort.  However, if you take a good look at the
>> 2000 holes, identify an interesting subset and submit a patch to fix that
>> subset ... that would be a worthwhile effort ... IMHO.
>
> I guess it's also a wasted effort to reduce struct tty from 8xx to 7xx 
> bytes, because it still allocates 1024 bytes of memory using malloc(9). I 
> guess we should mainly focus on structures that are allocated using uma(9) 
> or are slightly bigger than 2^n.

There are two things we can do: we can allocate using a specific UMA zone, but 
we could also retune our malloc buckets to waste less space while avoiding 
commiting memory to specific types where it's unhelpful (when UMA is used, we 
populate caches of pre-initialized instances, so we don't want to use UMA for 
things allocated, say, six times).

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-hackers mailing list