From: Peppe CAVALLARO <peppe.cavallaro@st.com> To: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Gleixner <tglx@linutronix.de>, Stuart MENEFY <stuart.menefy@st.com>, "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, John Stultz <johnstul@us.ibm.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux@arm.linux.org.uk" <linux@arm.linux.org.uk> Subject: Re: [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure Date: Thu, 03 Mar 2011 10:25:26 +0000 [thread overview] Message-ID: <4D6F6C96.1010303@st.com> (raw) In-Reply-To: <201103030945.07486.arnd@arndb.de> Hi Arnd, On 3/3/2011 9:45 AM, Arnd Bergmann wrote: > > On Wednesday 02 March 2011, Peppe CAVALLARO wrote: > > At any rate, I am happy to use the stmmac as experimental > > driver to do this kind tests. > > Indeed, in the past, on old Kernel (IIRC 2.6.23), I tried to use > > the kernel timers but I removed the code from it because > > I had noticed packets loss and a strange phenomenon with cyclesoak > > (that showed broken sysload % during the heavy network activities). > > > > Let me know how to proceed: > > > > 1) experiment with stmmac and hrtimer for handling rx/tx? > > 2) rework the patches for the Generic Timer Infra? > > I'd suggest doing the first. I'm surprised that using an unrelated > timer for processing interrupts even helps you on stmmac. > Indeed, this helped especially to save the cpu usage on heavy IP traffic (but with Max Throughput and no pkt loss). > The timers that you'd normally use for rx interrupt mitigation > are not periodic timers but are started when a packet arrives > from the outside. > Yes you are right but unfortunately our mac devices have not this kind of HW. > > Doing periodic wakeups for RX instead of just waiting for > packets to come in should have a significant impact on power > management on an otherwise idle system. > To "mitigate" this issue, the driver does a fast (and extra) check in the rings and it does not start any rx processes in case there are no incoming frames. > For tx resource reclaim, a relatively slow oneshot timer (not > even hrtimer) should be good enough, since it only needs to be > active when there is no other way to clean up. E.g. when you > are in napi polling mode (interrupt disabled), you know that > stmmac_poll gets called soon, and you can also do the reclaim > from stmmac_xmit() in order to prevent the timer from triggering > when you are constantly transmitting. > This logic is already in the driver, indeed. What I've seen on our embedded systems is that the cost of RX interrupts is very hight and NAPI partially helps. Typically, in an IP-STB, I receive a burst of UDP pkt and this means that many interrupts occur (~99% of CPU usage on slow platforms). With the ext timer I was able to reduce the CPU usage in these kind of scenarios to ~50%. When there is no net traffic, indeed, the timer periodically "disturbs" the system but the impact on the CPU usage actually is low. Thanks Peppe > > Arnd >
WARNING: multiple messages have this Message-ID (diff)
From: Peppe CAVALLARO <peppe.cavallaro@st.com> To: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Gleixner <tglx@linutronix.de>, Stuart MENEFY <stuart.menefy@st.com>, "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, John Stultz <johnstul@us.ibm.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux@arm.linux.org.uk" <linux@arm.linux.org.uk> Subject: Re: [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure Date: Thu, 3 Mar 2011 11:25:26 +0100 [thread overview] Message-ID: <4D6F6C96.1010303@st.com> (raw) In-Reply-To: <201103030945.07486.arnd@arndb.de> Hi Arnd, On 3/3/2011 9:45 AM, Arnd Bergmann wrote: > > On Wednesday 02 March 2011, Peppe CAVALLARO wrote: > > At any rate, I am happy to use the stmmac as experimental > > driver to do this kind tests. > > Indeed, in the past, on old Kernel (IIRC 2.6.23), I tried to use > > the kernel timers but I removed the code from it because > > I had noticed packets loss and a strange phenomenon with cyclesoak > > (that showed broken sysload % during the heavy network activities). > > > > Let me know how to proceed: > > > > 1) experiment with stmmac and hrtimer for handling rx/tx? > > 2) rework the patches for the Generic Timer Infra? > > I'd suggest doing the first. I'm surprised that using an unrelated > timer for processing interrupts even helps you on stmmac. > Indeed, this helped especially to save the cpu usage on heavy IP traffic (but with Max Throughput and no pkt loss). > The timers that you'd normally use for rx interrupt mitigation > are not periodic timers but are started when a packet arrives > from the outside. > Yes you are right but unfortunately our mac devices have not this kind of HW. > > Doing periodic wakeups for RX instead of just waiting for > packets to come in should have a significant impact on power > management on an otherwise idle system. > To "mitigate" this issue, the driver does a fast (and extra) check in the rings and it does not start any rx processes in case there are no incoming frames. > For tx resource reclaim, a relatively slow oneshot timer (not > even hrtimer) should be good enough, since it only needs to be > active when there is no other way to clean up. E.g. when you > are in napi polling mode (interrupt disabled), you know that > stmmac_poll gets called soon, and you can also do the reclaim > from stmmac_xmit() in order to prevent the timer from triggering > when you are constantly transmitting. > This logic is already in the driver, indeed. What I've seen on our embedded systems is that the cost of RX interrupts is very hight and NAPI partially helps. Typically, in an IP-STB, I receive a burst of UDP pkt and this means that many interrupts occur (~99% of CPU usage on slow platforms). With the ext timer I was able to reduce the CPU usage in these kind of scenarios to ~50%. When there is no net traffic, indeed, the timer periodically "disturbs" the system but the impact on the CPU usage actually is low. Thanks Peppe > > Arnd >
next prev parent reply other threads:[~2011-03-03 10:25 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-22 10:17 [PATCH 0/4] simple generic timer infrastructure and stmmac example Peppe CAVALLARO 2011-02-22 10:17 ` Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure Peppe CAVALLARO 2011-02-22 10:17 ` Peppe CAVALLARO 2011-02-24 17:20 ` Arnd Bergmann 2011-02-24 17:20 ` Arnd Bergmann 2011-03-01 15:20 ` Stuart Menefy 2011-03-01 15:20 ` Stuart Menefy 2011-03-01 16:43 ` Arnd Bergmann 2011-03-01 16:43 ` Arnd Bergmann 2011-03-01 20:26 ` Russell King - ARM Linux 2011-03-01 20:26 ` Russell King - ARM Linux 2011-03-01 20:41 ` Arnd Bergmann 2011-03-01 20:41 ` Arnd Bergmann 2011-03-01 16:48 ` Thomas Gleixner 2011-03-01 16:48 ` Thomas Gleixner 2011-03-02 17:35 ` Peppe CAVALLARO 2011-03-02 17:35 ` Peppe CAVALLARO 2011-03-03 8:45 ` Arnd Bergmann 2011-03-03 8:45 ` Arnd Bergmann 2011-03-03 10:25 ` Peppe CAVALLARO [this message] 2011-03-03 10:25 ` Peppe CAVALLARO 2011-03-03 13:55 ` Arnd Bergmann 2011-03-03 13:55 ` Arnd Bergmann 2011-03-04 6:53 ` Peppe CAVALLARO 2011-03-04 6:53 ` Peppe CAVALLARO 2012-06-12 3:04 ` Paul Mundt 2012-06-12 3:04 ` Paul Mundt 2011-02-22 10:17 ` [PATCH (sh-2.6) 2/4] sh_timer: add the support to use the generic Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (sh-2.6) 2/4] sh_timer: add the support to use the generic timer Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (net-2.6) 3/4] stmmac: switch to use the new " Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (net-2.6) 3/4] stmmac: switch to use the new generic timer interface Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (net-2.6) 4/4] stmmac: rework and improvement the stmmac Peppe CAVALLARO 2011-02-22 10:17 ` [PATCH (net-2.6) 4/4] stmmac: rework and improvement the stmmac timer Peppe CAVALLARO
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=4D6F6C96.1010303@st.com \ --to=peppe.cavallaro@st.com \ --cc=arnd@arndb.de \ --cc=johnstul@us.ibm.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-sh@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=netdev@vger.kernel.org \ --cc=stuart.menefy@st.com \ --cc=tglx@linutronix.de \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.