Re: [patch] uninline init_waitqueue_*() functions

Ingo Molnar
2006-07-05T10:52:19Z

* Andrew Morton <akpm@osdl.org> wrote:

> > > > shrinks fs/select.o by eight bytes. (More than I expected). So
> > > > it does appear to be a space win, but a pretty slim one.
> > >
> > > there are 855 calls to these functions in the allyesconfig vmlinux
> > > i did, and i measured a combined size reduction of 34791 bytes.
> > > That averages to a 40 bytes win per call site. (on i386.)
> >
> > And more importantly it's a function that's called in slowpathes per
> > definition. So saving text sounds like a good idea, how minimal it
> > may be.
>
> Well yes - as I said, it's a net win. But 31 bytes per callsite seems
> weird and makes one wonder what's going on.

that's how big those instructions are roughly, while with the function
call we likely have those parameters in registers already, mitigating
some of the function-call overhead. (these tests were done with REGPARM
turned on)

some of the assignments are also indirect, necessiating further loads,
such as:

INIT_LIST_HEAD(&q->task_list);

i roughly expected a net uninlining win of roughly this magnitude.

Ingo