netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: acme@ghostprotocols.net
Cc: xemul@openvz.org, devel@openvz.org, netdev@vger.kernel.org
Subject: Re: [PATCH] Compact sk_stream_mem_schedule() code
Date: Mon, 19 Nov 2007 23:22:45 -0800 (PST)	[thread overview]
Message-ID: <20071119.232245.246671296.davem@davemloft.net> (raw)
In-Reply-To: <20071119193059.GA5211@ghostprotocols.net>

From: Arnaldo Carvalho de Melo <acme@ghostprotocols.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@openvz.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@redhat.com>

I've applied the patch, thanks Pavel.

      reply	other threads:[~2007-11-20  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 12:13 [PATCH] Compact sk_stream_mem_schedule() code Pavel Emelyanov
2007-11-19 19:30 ` Arnaldo Carvalho de Melo
2007-11-20  7:22   ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071119.232245.246671296.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@ghostprotocols.net \
    --cc=devel@openvz.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).