Skip to contentSkip to conversation

Merge __load_pointer() and load_pointer() in net/core/filter.c; kernel 2.6.14

PATCH Kris Katterjohn 1 participant 1 message Nov 3, 2005

lore
Share & tools
lore
#0 lore raw

From: Mitchell Blank Jr

Quoted 9 lines
Quoted 5 lines

Kris Katterjohn wrote:
Forgive me because this is one of my first attempts at anything related to the kernel, but...

1) How would I go about benchmarking this?

The first thing to do is run "size net/core/filter.o" before and after and see if your change makes the "text" section larger.

Quoted 8 lines

The risk of putting more stuff into the inlined function is just that the rarely-executed path will end up duplicated in a bunch of places, bloating the generated code. It's hard to directly benchmark the effects of this but it will generally make the fast-path code less compact in the L1 I-cache which (if you do it enough) slows everything down. Thats one reason why kernel developers try to keep a close eye on bloat.

-Mitch

Before patch:

text data bss dec hex filename
2399 0 0 2399 95f x/net/core/filter.o

After patch:

text data bss dec hex filename
2589 0 0 2589 a1d y/net/core/filter.o

After patch without inlining the function:

text data bss dec hex filename
2127 0 0 2127 84f y/net/core/filter.o

So I guess use my patch and take "inline" off? What do you think?

Thanks