[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20071119.232245.246671296.davem@davemloft.net>
Date: Mon, 19 Nov 2007 23:22:45 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: acme@...stprotocols.net
Cc: xemul@...nvz.org, devel@...nvz.org, netdev@...r.kernel.org
Subject: Re: [PATCH] Compact sk_stream_mem_schedule() code
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Date: Mon, 19 Nov 2007 17:30:59 -0200
> 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@...nvz.org>
>
> I wonder if making it 'const struct proto *prot = sk->sk_prot;'
>
> would make any difference.
Such experiments are always useful, but I doubt there will
be substantial gains in this case.
> Acked-by: Arnaldo Carvalho de Melo <acme@...hat.com>
I've applied the patch, thanks Pavel.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists