From: Peter Hurley <peter@hurleysoftware.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>,
Francois Romieu <romieu@fr.zoreil.com>,
Eric Dumazet <edumazet@google.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg KH <gregkh@linuxfoundation.org>,
dmaengine@vger.kernel.org,
John Ogness <john.ogness@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Softirq priority inversion from "softirq: reduce latencies"
Date: Mon, 29 Feb 2016 11:13:36 -0800 [thread overview]
Message-ID: <56D49860.7040303@hurleysoftware.com> (raw)
In-Reply-To: <1456759643.648.65.camel@edumazet-ThinkPad-T530>
On 02/29/2016 07:27 AM, Eric Dumazet wrote:
> On lun., 2016-02-29 at 07:03 -0800, Peter Hurley wrote:
>
>> The reason why Eric's change is so effective for Eric's workload is
>> that it fixes the problem where NET_RX keeps getting new network packets
>> so it keeps looping, servicing more NET_RX softirq.
>
> You have very little idea of what is happening in networking land.
While that is true, I can read a trace:
** already in NET_RX softirq **
<idle>-0 0..s2 15us : kmem_cache_alloc: call_site=c08378e4 ptr=de55d7c0 bytes_req=192 bytes_alloc=192 gfp_flags=GFP_ATOMIC
<idle>-0 0..s2 23us : netif_receive_skb_entry: dev=eth0 napi_id=0x0 queue_mapping=0 skbaddr=dca04400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x000
0 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=88 data_len=0 truesize=1984 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0x0
<idle>-0 0..s2 30us+: netif_receive_skb: dev=eth0 skbaddr=dca04400 len=88
<idle>-0 0d.s5 98us : sched_waking: comm=sshd pid=750 prio=120 target_cpu=000
<idle>-0 0d.s6 105us : sched_stat_sleep: comm=sshd pid=750 delay=3125230447 [ns]
<idle>-0 0dns6 110us+: sched_wakeup: comm=sshd pid=750 prio=120 target_cpu=000
<idle>-0 0dns4 123us+: timer_start: timer=dc940e9c function=tcp_delack_timer expires=9746 [timeout=10] flags=0x00000000
<idle>-0 0dnH3 150us : irq_handler_entry: irq=176 name=4a100000.ethernet
<idle>-0 0dnH3 153us : softirq_raise: vec=3 [action=NET_RX]
<idle>-0 0dnH3 155us : irq_handler_exit: irq=176 ret=handled
<idle>-0 0dnH3 160us : irq_handler_entry: irq=20 name=49000000.edma_ccint
<idle>-0 0dnH3 163us : irq_handler_exit: irq=20 ret=handled
<idle>-0 0.ns2 169us : napi_poll: napi poll on napi struct de465c30 for device eth0
<idle>-0 0.ns2 171us : softirq_exit: vec=3 [action=NET_RX]
As you can see, NET_RX softirq is re-raised while in NET_RX softirq,
as a result of receiving new packets. So NET_RX will keep looping,
which is what I wrote.
> Once hard irq for RX has triggered, we arm a NAPI (NET_RX softirq), and
> no more irq will come unless the napi handler ran. Then when NAPI is
> complete, we re-allow interrupt to be delivered when a new packet is
> coming.
>
> Yes, ksoftirqd runs under load, and this is _wanted_.
>
> Sure, it might add a latency if some high prio task is wanting the same
> cpu, but this is exactly the purpose of having multi tasking.
>
>
next prev parent reply other threads:[~2016-02-29 19:13 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 18:19 Softirq priority inversion from "softirq: reduce latencies" Peter Hurley
2016-02-27 20:13 ` Eric Dumazet
2016-02-27 20:29 ` Peter Hurley
2016-02-27 23:04 ` David Miller
2016-02-27 23:33 ` Peter Hurley
2016-02-28 1:59 ` Eric Dumazet
2016-02-28 2:10 ` Peter Hurley
2016-02-28 2:17 ` Eric Dumazet
2016-02-28 4:46 ` David Miller
2016-02-28 5:55 ` Mike Galbraith
2016-02-28 17:01 ` Francois Romieu
2016-02-29 4:58 ` Mike Galbraith
2016-02-29 15:03 ` Peter Hurley
2016-02-29 15:19 ` Eric Dumazet
2016-02-29 15:54 ` Peter Hurley
2016-02-29 16:21 ` Eric Dumazet
2016-02-29 18:05 ` Peter Hurley
2016-02-29 18:24 ` Eric Dumazet
2016-02-29 18:53 ` Peter Hurley
2016-02-29 19:14 ` Thomas Gleixner
2016-02-29 20:24 ` David Miller
2016-02-29 23:04 ` Peter Hurley
2016-02-29 15:27 ` Eric Dumazet
2016-02-29 19:13 ` Peter Hurley [this message]
2016-02-29 19:43 ` Eric Dumazet
2016-02-29 15:40 ` Mike Galbraith
2016-02-29 15:58 ` Peter Hurley
2016-02-29 16:24 ` Eric Dumazet
2016-02-29 17:16 ` David Miller
2016-03-07 15:31 ` Sebastian Andrzej Siewior
2016-03-07 17:06 ` Mike Galbraith
2016-03-07 15:48 ` Sebastian Andrzej Siewior
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=56D49860.7040303@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=dmaengine@vger.kernel.org \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--cc=tglx@linutronix.de \
--cc=umgwanakikbuti@gmail.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).