From: Mandeep Singh Baines <mandeep.baines@gmail.com>
To: James Chapman <jchapman@katalix.com>
Cc: Mandeep Singh Baines <mandeep.baines@gmail.com>,
netdev@vger.kernel.org, hadi@cyberus.ca, davem@davemloft.net,
jeff@garzik.org, ossthema@de.ibm.com,
Stephen Hemminger <shemminger@osdl.org>
Subject: Re: RFC: possible NAPI improvements to reduce interrupt rates for low traffic rates
Date: Sat, 8 Sep 2007 09:42:22 -0700 [thread overview]
Message-ID: <20070908164222.GB3765@ludhiana> (raw)
In-Reply-To: <46E11C07.50307@katalix.com>
James Chapman (jchapman@katalix.com) wrote:
> Hi Mandeep,
>
> Mandeep Singh Baines wrote:
>> Hi James,
>> I like the idea of staying in poll longer.
>> My comments are similar to what Jamal and Stephen have already
>> said.
>> A tunable (via sysfs) would be nice.
>> A timer might be preferred to jiffy polling. Jiffy polling will not
>> increase latency the way a timer would. However, jiffy polling will
>> consume a lot more
>> CPU than a timer would. Hence more power. For jiffy polling, you
>> could have thousands of calls to poll for a single packet received.
>> While in a timer approach the numbers of polls per packet is upper
>> bound to 2.
>
> Why would using a timer to hold off the napi_complete() rather than
> jiffy count limit the polls per packet to 2?
>
I was thinking a timer could be used in the way suggested in Jamal's
paper. The driver would do nothing (park) until the timer expires. So
there would be no calls to poll for the duration of the timer. Hence,
this approach would add extra latency not present in a jiffy polling
approach.
>> I think it may difficult to make poll efficient for the no packet
>> case because,
>> at a minimum, you have to poll the device state via the has_work
>> method.
>
> Why wouldn't it be efficient? It would usually be done by reading an
> "interrupt pending" register.
>
Reading the "interrupt pending" register would require an MMIO read.
MMIO reads are very expensive. In some systems the latency of an MMIO
read can be 1000x that of an L1 cache access.
You can use mmio_test to measure MMIO read latency on your system:
http://svn.gnumonks.org/trunk/mmio_test/
However, work_done() doesn't have to be inefficient. For newer
devices you can implement work_done() without an MMIO read by polling
the next ring entry status in memory or some other mechanism. Since
PCI is coherent, acceses to this memory location could be cached
after the first miss. For architectures where PCI is not coherent you'd
have to go to memory for every poll. So for these architectures has_work()
will be moderately expensive (memory access) even when has_work() does
not require an MMIO read. This might affect home routers: not sure if MIPS or
ARM have coherent PCI.
>> If you go to a timer implementation then having a tunable will be
>> important.
>> Different appications will have different requirements on delay and
>> jitter.
>> Some applications may want to trade delay/jitter for less CPU/power
>> consumption and some may not.
>
> I agree. I'm leaning towards a new ethtool parameter to control this
> to be consistent with other per-device tunables.
>
>> imho, the work should definately be pursued further:)
>
> Thanks Mandeep. I'll try. :)
>
> --
> James Chapman
> Katalix Systems Ltd
> http://www.katalix.com
> Catalysts for your Embedded Linux software development
>
next prev parent reply other threads:[~2007-09-08 16:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-06 14:16 RFC: possible NAPI improvements to reduce interrupt rates for low traffic rates James Chapman
2007-09-06 14:37 ` Stephen Hemminger
2007-09-06 15:30 ` James Chapman
2007-09-06 15:37 ` Stephen Hemminger
2007-09-06 16:07 ` James Chapman
2007-09-06 23:06 ` jamal
2007-09-07 9:31 ` James Chapman
2007-09-07 13:22 ` jamal
2007-09-10 9:20 ` James Chapman
2007-09-10 12:27 ` jamal
2007-09-12 7:04 ` Bill Fink
2007-09-12 12:12 ` jamal
2007-09-12 13:50 ` James Chapman
2007-09-12 14:02 ` Stephen Hemminger
2007-09-12 16:26 ` James Chapman
2007-09-12 16:47 ` Mandeep Baines
2007-09-13 6:57 ` David Miller
2007-09-14 13:14 ` jamal
2007-09-07 21:20 ` Jason Lunz
2007-09-10 9:25 ` James Chapman
2007-09-07 3:55 ` Mandeep Singh Baines
2007-09-07 9:38 ` James Chapman
2007-09-08 16:42 ` Mandeep Singh Baines [this message]
2007-09-10 9:33 ` James Chapman
2007-09-10 12:12 ` jamal
2007-09-08 16:32 ` Andi Kleen
2007-09-10 9:25 ` James Chapman
2007-09-12 15:12 ` David Miller
2007-09-12 16:39 ` James Chapman
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=20070908164222.GB3765@ludhiana \
--to=mandeep.baines@gmail.com \
--cc=davem@davemloft.net \
--cc=hadi@cyberus.ca \
--cc=jchapman@katalix.com \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=ossthema@de.ibm.com \
--cc=shemminger@osdl.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