Re: pahole - Finding holes in kernel structs

2009-02-15 Thread Joseph Koshy
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... That is one of the tools that I've

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Kostik Belousov
On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: I found this useful tool called pahole[1]. It basically finds holes within structs, so for example on my 64bit machine this struct: struct test { int foo; const char *bar; int blah; } Would have a hole between

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Andrew Brampton
2009/2/12 Kostik Belousov kostik...@gmail.com: On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that Did you ported it to FreeBSD, or run on the Linux host ? Sorry no, I just ran it from a Linux host, but to my

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Harald Servat
On Thu, Feb 12, 2009 at 3:13 PM, Kostik Belousov kostik...@gmail.comwrote: On Thu, Feb 12, 2009 at 02:08:22PM +, Andrew Brampton wrote: I found this useful tool called pahole[1]. It basically finds holes within structs, so for example on my 64bit machine this struct: struct test {

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Julian Stacey
1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing in man gcc Optimization Options. Cheers, Julian -- Julian Stacey: BSDUnixLinux

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Max Laier
On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rearranged to fill the gap. Interesting tool ... I've made the list available here[2]. So my

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Ed Schouten
* Max Laier m...@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

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Sam Leffler
Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rearranged to fill the gap. Interesting tool ... Someone should be able to do

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Jille Timmermans
Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing in man gcc Optimization Options. There is a __packed

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Max Laier
On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rearranged to fill the gap.

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Brooks Davis
On Thu, Feb 12, 2009 at 05:54:24PM +0100, Max Laier wrote: On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Julian Stacey
Hi, Reference: From: Jille Timmermans ji...@quis.cx Date: Thu, 12 Feb 2009 17:34:23 +0100 Message-id: 49944f8f.5080...@quis.cx Jille Timmermans wrote: Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
On Thu, 12 Feb 2009, Max Laier wrote: That's the tricky part. Rearranging the structs itself is not that difficult, but identifying which should be rearranged and if, how ... that's the problem. The fact that gaps might be different for 64 vs. 32 bit architectures has already been

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
On Thu, 12 Feb 2009, Ed Schouten wrote: * Max Laier m...@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

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Sam Leffler
Max Laier wrote: On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: Max Laier wrote: On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Robert Watson
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

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Bakul Shah
So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that many of the struct had holes, and some of which could be rearranged to fill the gap. ... Certainly plugging holes can also be beneficial but just cautioning that changes of this sort need to be checked if made to

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Marcel Moolenaar
On Feb 12, 2009, at 8:34 AM, Jille Timmermans wrote: Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to automatically re-order variables ? but found nothing

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Nate Eldredge
On Thu, 12 Feb 2009, Marcel Moolenaar wrote: On Feb 12, 2009, at 8:34 AM, Jille Timmermans wrote: Julian Stacey schreef: 1) Is it worth my time trying to rearrange structs? I wondered whether as a sensitivity test, some version of gcc (or its competitor ?) might have capability to

Re: pahole - Finding holes in kernel structs

2009-02-12 Thread Garance A Drosehn
At 2:08 PM + 2/12/09, Andrew Brampton wrote: I found this useful tool called pahole[1]. It basically finds holes within structs, so for example on my 64bit machine this struct: struct test { int foo; const char *bar; int blah; } Would have a hole between foo and bar of 4 bytes