]> git.baikalelectronics.ru Git - kernel.git/commit
[NET]: Compact sk_stream_mem_schedule() code
authorPavel Emelyanov <xemul@openvz.org>
Tue, 20 Nov 2007 07:20:59 +0000 (23:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:54:36 +0000 (14:54 -0800)
commit4ca904030d1a5abb71e44dc7e316ab9579cdf0bf
tree5492ce13e237b6fb9cf284d3fdfd062793dc1126
parent8681b34db30cfa936a535a146b3617ccc29d59da
[NET]: Compact sk_stream_mem_schedule() code

This function references sk->sk_prot->xxx for many times.
It turned out, that there's so many code in it, that gcc
cannot always optimize access to sk->sk_prot's fields.

After saving the sk->sk_prot on the stack and comparing
disassembled code, it turned out that the function became
~10 bytes shorter and made less dereferences (on i386 and
x86_64). Stack consumption didn't grow.

Besides, this patch drives most of this function into the
80 columns limit.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/stream.c