From: Jeff Garzik <jeff@garzik.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Linus Torvalds <torvalds@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Christoph Hellwig <hch@infradead.org>,
john stultz <johnstul@us.ibm.com>,
Oleg Nesterov <oleg@tv-sign.ru>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Dipankar Sarma <dipankar@in.ibm.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [RFC PATCH 0/6] Convert all tasklets to workqueues
Date: Thu, 28 Jun 2007 13:44:13 -0400 [thread overview]
Message-ID: <4683F36D.7080100@garzik.org> (raw)
In-Reply-To: <20070628160001.GA15495@elte.hu>
Ingo Molnar wrote:
> But it was not me who claimed that 'workqueues are slow'.
The claim was: slower than tasklets.
> choice. I am just wondering out loud whether this particular tool, in
> its current usage pattern, makes much technological sense. My claim is:
> it could very well be that it doesnt make _much_ sense, and in that case
> we should provide a non-intrusive migration path away in terms of a
> compatible API wrapper to a saner (albeit by virtue of trying to emulate
> an existing API, slower) mechanism. The examples cited so far had the
> tasklet as an intermediary towards a softirq - what's the technological
> point in such a splitup?
I already answered that in detail. In sum, a driver cannot define its
own softirq. Softirqs are not modular.
Tasklets are the closest thing to softirqs for a driver.
> The most scalable workloads dont involve any (or many) softirq middlemen
> at all: you queue work straight from the hardirq context to the target
> process context. And that's what you want to do _anyway_, because you
> want to create as little locally cached data for the hardirq context, as
> the target task could easily be on another CPU. (this is generally true
> for things like block IO, but it's also true for things like network
> IO.)
>
> the most scalable solution would be _for the network adapter to figure
> out the target CPU for the packet_.
I agree completely. Wanna implement this? I will kiss your feet, and
multi-core CPU vendors will worship you as a demi-god.
Until such time, we must deal with the network stack as it exists today,
and the network drivers as they exist and work today.
> Not many (if any) such adapters
> exist at the moment. (as it would involve allocating NR_CPUs irqs to
> that adapter alone.)
Good news: this is becoming the norm for modern NICs, especially 10Gbps.
Plenty of NICs already exist that support multiple RX rings (persumably
one per CPU), and newer NICs will raise individual MSI[-X] interrupts
based on the RX ring into which a packet was received.
In this area, NIC vendors are way ahead of the Linux net stack.
The Linux net stack is unfortunately not threaded enough to sanely deal
with dividing /flows/ up across multiple CPUs, even if the NIC does
support multiple transmit and receive queues. [side note: initial
multi-queue TX is being worked on, on netdev]
>> Tasklet is single thread by definition and purpose. Those a few places
>> where people used tasklets to do per-cpu jobs (RCU f.e.) exist just
>> because they had troubles with allocating new softirq. [...]
>
> no. The following tale is the true and only history of the RCU tasklet
> ;-) The RCU guys first used a tasklet, then noticed its bad scalability
> (a particular VFS-intense benchmark regressed because only a single CPU
> would do RCU completion on an 8-way box) so they switched it to a
> per-cpu tasklet - without realizing that a per-cpu tasklet is in essence
> a softirq. I pointed it out to them (years down the road ...) then the
> "convert rcu-tasklet to softirq" patch was born.
You focused on the example rather than the key phrase: tasklet is
single thread by definition and purpose.
Wanting to change that without analysis of the impact illustrates the
apples-to-oranges change being proposed.
> outlined above: if you want good scalability, dont use middlemen :-)
> Figure out the target task as early as possible and let it do as much of
> the remaining work as possible. _Increasing_ the amount of cached
> context (by doing delayed processing in tasklets or even softirqs on the
> same CPU where the hardirq arrived) only increases the cross-CPU cost.
> Keeping stuff in a softirq only makes (some) sense as long as you have
> no target task at all (routing, filtering, etc.).
I do not disagree with these theoretical musings :)
I care the most about the "who will do all this work?" question. In
network driver land, these changes impact hot paths. I am lazy, and
don't care to revisit each network driver hot path and carefully re-tune
each based on this proposal. Who is volunteering?
Jeff
next prev parent reply other threads:[~2007-06-28 17:44 UTC|newest]
Thread overview: 129+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 4:00 [RFC PATCH 0/6] Convert all tasklets to workqueues Steven Rostedt
2007-06-22 4:00 ` [RFC PATCH 1/6] Convert the RCU tasklet into a softirq Steven Rostedt
2007-06-22 7:10 ` Christoph Hellwig
2007-06-22 7:43 ` Ingo Molnar
2007-06-22 12:35 ` Steven Rostedt
2007-06-22 12:55 ` Ingo Molnar
2007-06-22 4:00 ` [RFC PATCH 2/6] Split out tasklets from softirq.c Steven Rostedt
2007-06-22 7:11 ` Christoph Hellwig
2007-06-22 12:40 ` Steven Rostedt
2007-06-22 13:45 ` Akinobu Mita
2007-06-22 13:58 ` Steven Rostedt
2007-06-22 4:00 ` [RFC PATCH 3/6] Add a tasklet is-scheduled API Steven Rostedt
2007-06-22 4:00 ` [RFC PATCH 4/6] Make DRM use the tasklet is-sched API Steven Rostedt
2007-06-22 6:36 ` Daniel Walker
2007-06-22 6:49 ` Thomas Gleixner
2007-06-22 7:08 ` Daniel Walker
2007-06-22 12:15 ` Steven Rostedt
2007-06-22 15:36 ` Daniel Walker
2007-06-22 22:38 ` Ingo Molnar
2007-06-22 23:28 ` Daniel Walker
2007-06-22 16:10 ` Arnd Bergmann
2007-06-22 16:56 ` Steven Rostedt
2007-06-22 18:24 ` Christoph Hellwig
2007-06-22 23:38 ` Dave Airlie
2007-06-22 4:00 ` [RFC PATCH 5/6] Move tasklet.h to tasklet_softirq.h Steven Rostedt
2007-06-22 4:00 ` [RFC PATCH 6/6] Convert tasklets to work queues Steven Rostedt
2007-06-22 7:06 ` Daniel Walker
2007-06-22 13:29 ` Steven Rostedt
2007-06-22 15:52 ` Oleg Nesterov
2007-06-22 16:35 ` Steven Rostedt
2007-06-23 11:15 ` Arnd Bergmann
2007-06-22 7:09 ` [RFC PATCH 0/6] Convert all tasklets to workqueues Christoph Hellwig
2007-06-22 7:51 ` Ingo Molnar
2007-06-22 7:53 ` Christoph Hellwig
2007-06-22 11:23 ` Ingo Molnar
2007-06-22 12:32 ` Steven Rostedt
2007-06-22 12:38 ` Ingo Molnar
2007-06-22 12:58 ` Steven Rostedt
2007-06-22 13:12 ` Ingo Molnar
2007-06-22 14:27 ` Steven Rostedt
2007-06-22 13:13 ` Andrew Morton
2007-06-22 13:26 ` Ingo Molnar
2007-06-22 13:41 ` Andrew Morton
2007-06-22 14:00 ` Ingo Molnar
2007-06-22 13:35 ` Steven Rostedt
2007-06-22 14:25 ` Arjan van de Ven
2007-06-22 14:42 ` Steven Rostedt
2007-06-22 14:43 ` Arjan van de Ven
2007-06-22 17:16 ` Linus Torvalds
2007-06-22 17:31 ` Steven Rostedt
2007-06-22 18:32 ` Christoph Hellwig
2007-06-22 20:40 ` Ingo Molnar
2007-06-22 21:00 ` Christoph Hellwig
2007-06-22 21:10 ` Ingo Molnar
2007-06-22 21:13 ` Thomas Gleixner
2007-06-22 21:37 ` Linus Torvalds
2007-06-22 21:59 ` Ingo Molnar
2007-06-22 22:09 ` Ingo Molnar
2007-06-22 22:43 ` Roland Dreier
2007-06-22 22:57 ` Alan Cox
2007-06-22 22:58 ` Steven Rostedt
2007-06-23 6:23 ` Dave Airlie
2007-06-24 15:16 ` Jonathan Corbet
2007-06-24 15:52 ` Steven Rostedt
2007-06-25 16:50 ` Tilman Schmidt
2007-06-25 17:06 ` Steven Rostedt
2007-06-25 20:50 ` Tilman Schmidt
2007-06-25 21:03 ` Steven Rostedt
2007-06-25 19:52 ` Stephen Hemminger
2007-06-26 0:00 ` Jonathan Corbet
2007-06-26 0:52 ` Steven Rostedt
2007-06-25 18:48 ` Kristian Høgsberg
2007-06-25 19:11 ` Steven Rostedt
2007-06-25 20:07 ` Kristian Høgsberg
2007-06-25 20:31 ` Steven Rostedt
2007-06-25 21:08 ` Kristian Høgsberg
2007-06-25 21:15 ` Ingo Molnar
2007-06-25 23:36 ` Stefan Richter
2007-06-26 0:46 ` Steven Rostedt
2007-06-26 1:46 ` Dan Williams
2007-06-26 2:01 ` Steven Rostedt
2007-06-26 2:12 ` Dan Williams
2007-06-28 12:37 ` Steven Rostedt
2007-06-28 16:37 ` Oleg Nesterov
2007-06-28 18:02 ` Dan Williams
2007-06-28 20:46 ` Steven Rostedt
2007-06-28 21:23 ` Dan Williams
2007-06-28 21:40 ` Dan Williams
2007-06-28 22:01 ` Steven Rostedt
2007-06-28 22:00 ` Steven Rostedt
2007-06-28 5:48 ` Jeff Garzik
2007-06-28 9:23 ` Ingo Molnar
2007-06-28 14:38 ` Alexey Kuznetsov
2007-06-28 15:23 ` Jeff Garzik
2007-06-28 15:54 ` Steven Rostedt
2007-06-28 16:00 ` Ingo Molnar
2007-06-28 17:26 ` Jeff Garzik
2007-06-28 17:44 ` Jeff Garzik [this message]
2007-06-28 18:19 ` Andrew Morton
2007-06-28 20:07 ` Ingo Molnar
2007-06-29 11:34 ` Alexey Kuznetsov
2007-06-29 11:48 ` Duncan Sands
2007-06-29 13:36 ` Alexey Kuznetsov
2007-06-29 14:01 ` Duncan Sands
2007-06-29 16:34 ` Alexey Kuznetsov
2007-06-29 12:29 ` Ingo Molnar
2007-06-29 13:25 ` Alexey Kuznetsov
2007-06-29 13:43 ` Ingo Molnar
2007-06-29 15:23 ` Alexey Kuznetsov
2007-06-29 13:41 ` Steven Rostedt
2007-06-29 14:24 ` Jeff Garzik
2007-06-29 14:26 ` Oleg Nesterov
2007-06-29 19:04 ` Alexey Kuznetsov
2007-06-29 14:27 ` Alexey Kuznetsov
2007-06-29 15:51 ` Oleg Nesterov
2007-06-29 16:21 ` Alexey Kuznetsov
2007-06-29 16:52 ` Oleg Nesterov
2007-06-29 17:09 ` Oleg Nesterov
2007-06-30 11:25 ` Oleg Nesterov
2007-06-28 15:17 ` Jeff Garzik
2007-06-22 21:53 ` Daniel Walker
2007-06-22 22:09 ` david
2007-06-22 22:15 ` Daniel Walker
2007-06-22 22:44 ` Ingo Molnar
2007-06-22 23:28 ` Daniel Walker
2007-06-22 22:15 ` Ingo Molnar
2007-06-23 5:14 ` Stephen Hemminger
-- strict thread matches above, loose matches on Subject: below --
2007-06-26 13:03 Clemens Ladisch
2007-06-26 13:15 ` Takashi Iwai
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=4683F36D.7080100@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=dipankar@in.ibm.com \
--cc=hch@infradead.org \
--cc=johnstul@us.ibm.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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