netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
	Eric Dumazet <eric.dumazet@gmail.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>,
	netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com
Subject: Re: [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs
Date: Tue, 12 May 2015 15:27:03 +0200	[thread overview]
Message-ID: <5551FFA7.4060709@iogearbox.net> (raw)
In-Reply-To: <20150512125526.GA3822@salvia>

Hi Pablo,

On 05/12/2015 02:55 PM, Pablo Neira Ayuso wrote:
> On Mon, May 11, 2015 at 04:30:38PM -0700, Eric Dumazet wrote:
>> On Mon, 2015-05-11 at 16:02 -0700, Alexei Starovoitov wrote:
>>> On 5/11/15 7:35 AM, Eric Dumazet wrote:
>>>>
>>>> -static inline int deliver_skb(struct sk_buff *skb,
>>>> +static noinline int deliver_skb(struct sk_buff *skb,
>>>>    			      struct packet_type *pt_prev,
>>>>    			      struct net_device *orig_dev)
>>>
>>> have tried the above only and didn't see any difference
>>> for simple 'netif_receive + drop in ip_rcv' test.
>>> Not sure whether it's actually worth doing. I would leave it as-is.
>>
>> Yes, this was probably too aggressive.
>
> I tested this noinline patch and I got a bit less performance here in
> my 32K i-cache testbed.
>
>> unlikely() or static_key_false() are no moving code away enough, whole
>> function including unused code pollutes icache.
>>
>> Code size increased a lot, while L1/L2 caches on cpu are about the same
>> than 6 years ago.
>
> OK, so that explains why I'm getting more performance with the patch
> that move the qdisc ingress code using the indirection, since that
> helped to move code away, right?
>
> BTW, looking at the emails, Daniel said:
>
> [...]
>> After your patch set:
>>
>> Samples: 50K of event 'cycles:k', Event count (approx.): 45160667741
>> +   40.49%  kpktgend_0  [kernel.kallsyms]  [k] __netif_receive_skb_core
>> +   31.21%  kpktgend_0  [kernel.kallsyms]  [k] kfree_skb
>> +    6.94%  kpktgend_0  [pktgen]           [k] pktgen_thread_worker
>> +    6.63%  kpktgend_0  [kernel.kallsyms]  [k] netif_receive_skb_internal
>> +    6.63%  kpktgend_0  [kernel.kallsyms]  [k] ip_rcv
>> +    3.30%  kpktgend_0  [kernel.kallsyms]  [k] netif_receive_skb_sk
>> +    3.30%  kpktgend_0  [kernel.kallsyms]  [k] __netif_receive_skb
>> +    0.96%  kpktgend_0  [kernel.kallsyms]  [k] __local_bh_enable_ip
>> +    0.37%  kpktgend_0  [kernel.kallsyms]  [k] kthread_should_stop
>> +    0.03%  kpktgend_0  [kernel.kallsyms]  [k] _cond_resched
>>
>> For *all* three, I reliably get ~40.0 Mpps with the benchmark.
>
> @Daniel, Alexei: Are you getting the same numbers with the indirection?

The above I tested was basically your set from here on top of net-next
when ingress is disabled. It didn't show an effect (similarly as the
printk bloat test patch on my side). So, judging from your observations,
the printk bloat would also make things slower on your side, right?

> What's the i-cache size in your testbed?

For the Xeon E3-1240, I get (via lscpu):

L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K

Best,
Daniel

  reply	other threads:[~2015-05-12 13:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 16:59 [PATCH 0/2 net-next] critical ingress path performance improvements Pablo Neira Ayuso
2015-05-10 16:59 ` [PATCH 1/2 net-next] net: kill useless net_*_ingress_queue() definitions when NET_CLS_ACT is unset Pablo Neira Ayuso
2015-05-10 16:58   ` Sergei Shtylyov
2015-05-10 16:59 ` [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs Pablo Neira Ayuso
2015-05-10 17:25   ` Eric Dumazet
2015-05-10 17:45   ` Alexei Starovoitov
2015-05-10 17:59     ` Pablo Neira Ayuso
2015-05-10 18:05       ` Alexei Starovoitov
2015-05-10 18:24         ` Pablo Neira Ayuso
2015-05-10 18:47           ` Alexei Starovoitov
2015-05-10 19:00             ` Pablo Neira Ayuso
2015-05-10 19:06               ` Alexei Starovoitov
2015-05-10 19:20                 ` Pablo Neira Ayuso
2015-05-10 19:37                   ` Alexei Starovoitov
2015-05-10 19:50                     ` Pablo Neira Ayuso
2015-05-10 21:31                       ` Daniel Borkmann
2015-05-10 21:44                         ` Daniel Borkmann
2015-05-10 23:43                           ` Pablo Neira Ayuso
2015-05-11  5:57                             ` Alexei Starovoitov
2015-05-11 12:49                               ` Jamal Hadi Salim
2015-05-11 12:58                               ` Daniel Borkmann
2015-05-11 17:15                                 ` Alexei Starovoitov
2015-05-11 13:32                               ` Pablo Neira Ayuso
2015-05-11 14:35                                 ` Eric Dumazet
2015-05-11 23:02                                   ` Alexei Starovoitov
2015-05-11 23:30                                     ` Eric Dumazet
2015-05-12  3:21                                       ` Alexei Starovoitov
2015-05-12 12:55                                       ` Pablo Neira Ayuso
2015-05-12 13:27                                         ` Daniel Borkmann [this message]
2015-05-12 21:22                                           ` Alexei Starovoitov
2015-05-12 21:43                                             ` Daniel Borkmann
2015-05-10 20:40             ` Daniel Borkmann

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=5551FFA7.4060709@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.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).