OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Compact sk_stream_mem_schedule() code
Re: [PATCH] Compact sk_stream_mem_schedule() code [message #23561 is a reply to message #23513] Mon, 19 November 2007 19:30 Go to previous message
Arnaldo Carvalho de M[1] is currently offline  Arnaldo Carvalho de M[1]
Messages: 1
Registered: November 2007
Junior Member
Em Mon, Nov 19, 2007 at 03:13:44PM +0300, Pavel Emelyanov escreveu:
> 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>

I wonder if making it 'const struct proto *prot = sk->sk_prot;'

would make any difference.

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 
Read Message
Read Message
Read Message
Previous Topic: [PATCH][net-2.6.25][NETNS] make netns cleanup to run in a separate workqueue
Next Topic: [PATCH 4/4] proc: fix PDE refcounting
Goto Forum:
  


Current Time: Thu Aug 28 21:25:54 GMT 2025

Total time taken to generate the page: 0.12727 seconds