Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 17:55:09 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-hackers@freebsd.org, Sam Leffler <sam@freebsd.org>, Andrew Brampton <brampton+freebsd-hackers@gmail.com>, Joseph Koshy <jkoshy@FreeBSD.org>
Subject:   Re: pahole - Finding holes in kernel structs
Message-ID:  <alpine.BSF.2.00.0902121752470.2205@fledge.watson.org>
In-Reply-To: <200902121754.24536.max@love2party.net>
References:  <d41814900902120608i4b54c86fp9f565bbeead5a476@mail.gmail.com> <200902121717.47841.max@love2party.net> <4994516B.8060703@freebsd.org> <200902121754.24536.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 12 Feb 2009, Max Laier 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.
>>
>> The other thing to keep in mind is that structure layout can have a 
>> noticeable effect on cache locality.  Arbitrarily rearranging structure 
>> members can generate many more cache misses so one should sanity check 
>> changes w/ something like hwpmc.  However as noted because layout may be 
>> platform-dependent even if something shows no change on x86 it may be a 
>> loss on another architecture and finding that performance drop may be 
>> really hard.
>
> Let's not be too "glass half empty" about it, though.  The same is true in 
> the opposite direction.  If we can identify and eliminate an unnecessary 
> hole in an important structure we might gain that same performance just by 
> reshuffling a few lines.

Well, I think we want to inform this through actual measurement.  Right now, 
tools like hwpmc track cache misses by point in executable code, but what 
would be nice is if we could post-process to generate cache miss information 
by data structure field...

Robert N M Watson
Computer Laboratory
University of Cambridge



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0902121752470.2205>