netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "Paweł Staszewski" <pstaszewski@itcare.pl>,
	"Linux Network Development list" <netdev@vger.kernel.org>
Subject: Re: Linux Route Cache performance tests
Date: Mon, 07 Nov 2011 15:33:42 +0100	[thread overview]
Message-ID: <1320676422.2361.18.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <1320673364.3020.21.camel@bwh-desktop>

Le lundi 07 novembre 2011 à 13:42 +0000, Ben Hutchings a écrit :

> A routing cache this big is not going to fit in the processor caches,
> anyway; in fact even the hash table may not.  So a routing cache hit is
> likely to involve processor cache misses.  After David's work to make
> cacheless operation faster, I suspect that such a 'hit' can be a net
> loss.  But it *is* necessary to run a benchmark to answer this (and the
> answer will obviously vary between systems).
> 

I dont know why you think full hash table should fit processor cache.
If it does, thats perfect, but its not a requirement.

This is one cache miss, to get the pointer to the first element in
chain. Of course this might be a cache hit if several packets for a
given flow are processed in a short period of time.

Given a dst itself is 256 bytes (4 cache lines), one extra cache miss to
get the pointer to dst is not very expensive.

At least, in recent kernels we dont change dst->refcnt in forwarding
patch (usinf NOREF skb->dst)

One particular point is the atomic_inc(dst->refcnt) we have to perform
when queuing an UDP packet if socket asked PKTINFO stuff (for example a
typical DNS server has to setup this option)

I have one patch somewhere that stores the information in skb->cb[] and
avoid the atomic_{inc|dec}(dst->refcnt).

  reply	other threads:[~2011-11-07 14:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 15:57 Linux Route Cache performance tests Paweł Staszewski
2011-11-06 17:29 ` Eric Dumazet
2011-11-06 18:28   ` Paweł Staszewski
2011-11-06 18:48     ` Eric Dumazet
2011-11-06 19:20       ` Paweł Staszewski
2011-11-06 19:38         ` Eric Dumazet
2011-11-06 20:25           ` Paweł Staszewski
2011-11-06 21:26             ` Eric Dumazet
2011-11-06 21:57               ` Paweł Staszewski
2011-11-06 23:08                 ` Eric Dumazet
2011-11-07  8:36                   ` Paweł Staszewski
2011-11-07  9:08                     ` Eric Dumazet
2011-11-07  9:16                       ` Eric Dumazet
2011-11-07 22:12                         ` Paweł Staszewski
2011-11-07 13:42           ` Ben Hutchings
2011-11-07 14:33             ` Eric Dumazet [this message]
2011-11-09 17:24               ` [PATCH net-next] ipv4: PKTINFO doesnt need dst reference Eric Dumazet
2011-11-09 21:37                 ` David Miller
2011-11-09 22:03                   ` Eric Dumazet
2011-11-10  0:29                     ` [PATCH net-next] bnx2x: reduce skb truesize by 50% Eric Dumazet
2011-11-10 15:05                       ` Eilon Greenstein
2011-11-10 15:27                         ` Eric Dumazet
2011-11-10 16:27                           ` Eilon Greenstein
2011-11-10 16:45                             ` Eric Dumazet
2011-11-13 18:53                               ` Eilon Greenstein
2011-11-13 19:42                                 ` Eric Dumazet
2011-11-13 20:08                                   ` Eilon Greenstein
2011-11-13 22:00                                     ` Eric Dumazet
2011-11-14  5:08                                       ` David Miller
2011-11-14  6:25                                         ` Eric Dumazet
2011-11-14 15:57                                           ` Eric Dumazet
2011-11-14 19:21                                             ` David Miller

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=1320676422.2361.18.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    /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).