[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFTL4hyPrwo+RXUkBp5FS_MC6qiMsK5bCVg2_tn0uPu6d_fgqg@mail.gmail.com>
Date: Tue, 9 Jan 2018 17:03:53 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Dmitry Safonov <dima@...sta.com>
Cc: linux-kernel@...r.kernel.org, 0x7f454c46@...il.com,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Ingo Molnar <mingo@...nel.org>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Paolo Abeni <pabeni@...hat.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Radu Rendec <rrendec@...sta.com>,
Rik van Riel <riel@...hat.com>,
Stanislaw Gruszka <sgruszka@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context
2018-01-09 14:36 UTC+01:00, Dmitry Safonov <dima@...sta.com>:
> Warning: Not merge-ready
>
> I. Current workflow of ksoftirqd.
> Softirqs are processed in the context of ksoftirqd iff they are
> being raised very frequently. How it works:
> do_softirq() and invoke_softirq() deffer pending softirq iff
> ksoftirqd is in runqueue. Ksoftirqd is scheduled mostly in the
> end of processed softirqs if 2ms were not enough to process all
> pending softirqs.
>
> Here is pseudo-picture of the workflow (for simplicity on UMP):
> ------------- ------------------ ------------------
> | ksoftirqd | | User's process | | Softirqs |
> ------------- ------------------ ------------------
> Not scheduled Running
> |
> o------------------------o
> |
> __do_softirq()
> |
> 2ms & softirq pending?
> Schedule ksoftirqd
> |
> Scheduled o------------------------o
> |
> o--------------------o
> |
> Running Scheduled
> |
> o--------------------o
> |
> Not scheduled Running
>
> Timegraph for the workflow,
> dash (-) means ksoftirqd not scheduled;
> equal(=) ksoftirqd is scheduled, a softirq may still be pending
>
> Pending softirqs
> | | | | | | | | |
> v v v v | | | | v
> Processing o-----o | | | | o--o
> softirqs | | | | | | | |
> | | | | | | | |
> | | | | | | | |
> Userspace o-o o=========o | | | | o----o o---------o
> <-2ms-> | | | | | |
> | v v v v |
> Ksoftirqd o----------o
>
> II. Corner-conditions.
> During testing of commit [1] on some non-mainstream driver,
> I've found that due to platform specifics, the IRQ is being
> raised too late (after softirq has been processed).
I'm a bit confused about that part. I would expect the softirq to be
raised by the IRQ.
So I guess in this scenario the softirq is raised by something else
and you expect the upcoming IRQ to handle the softirq, right? (sorry
I'm not used to networking code).
Thanks.
> In result softirqs steal time from userspace process, leaving
> it starving for CPU time and never/rarely scheduling ksoftirqd:
Powered by blists - more mailing lists