netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, hadi@cyberus.ca, therbert@google.com
Subject: Re: [PATCH net-next-2.6] net: __alloc_skb() speedup
Date: Wed, 05 May 2010 14:52:40 -0700 (PDT)	[thread overview]
Message-ID: <20100505.145240.28817983.davem@davemloft.net> (raw)
In-Reply-To: <1273060809.2367.67.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 05 May 2010 14:00:09 +0200

> Sorry, I was thinking about the shinfo part :
> 
> memset(shinfo, 0, offsetof(struct skb_shared_info, dataref));
> 
> offsetof(struct skb_shared_info, dataref) is small enough and we dont
> dirty a full cache line, so maybe I can keep prefetchw(data + size) ?

You do dirty a full line on sparc64, the prefetch invalidate goes a L1
cache line at a time, so 32 bytes.  And this memset() is 40 bytes.
The call to the memset symbol is still generated by gcc for this case.

I think the cutoff for doing it inline is something like 16 bytes on
sparc64, four 64-bit loads and stores.

Unlike x86 these risc chips don't have string-op instructions, and for
sparc64 and powerpc the instructions are fixed in size (4 bytes) so
the inline cost is "(memset_size / word_size) * 4".  Whereas on x86 the
inlining cost is more-or-less fixed.

> If not, in which cases can we use prefetchw() in kernel, if some arches
> dont handle it well ?

It has to be looked at in a case-by-case basis.  There is no simple
answer here.

      reply	other threads:[~2010-05-05 21:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 17:10 [PATCH net-next-2.6] net: __alloc_skb() speedup Eric Dumazet
2010-05-05  8:06 ` David Miller
2010-05-05  8:22   ` Eric Dumazet
2010-05-05  8:26     ` David Miller
2010-05-05 12:00       ` Eric Dumazet
2010-05-05 21:52         ` 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=20100505.145240.28817983.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    /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).