From: Markus Pargmann <mpa@pengutronix.de>
To: Joe Perches <joe@perches.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
Wolfgang Grandegger <wg@grandegger.com>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH v2] can: c_can: Speed up rx_poll function
Date: Wed, 30 Oct 2013 08:54:46 +0100 [thread overview]
Message-ID: <20131030075446.GE20839@pengutronix.de> (raw)
In-Reply-To: <1383063845.2713.15.camel@joe-AO722>
On Tue, Oct 29, 2013 at 09:24:05AM -0700, Joe Perches wrote:
> On Tue, 2013-10-29 at 09:58 +0100, Markus Pargmann wrote:
> > On Tue, Oct 29, 2013 at 01:34:48AM -0700, Joe Perches wrote:
> > > On Tue, 2013-10-29 at 09:27 +0100, Markus Pargmann wrote:
> > > > This patch speeds up the rx_poll function by reducing the number of
> > > > register reads.
> > > []
> > > > 125kbit:
> > > > Function Hit Time Avg s^2
> > > > -------- --- ---- --- ---
> > > > c_can_do_rx_poll 63960 10168178 us 158.977 us 1493056 us
> > > > With patch:
> > > > c_can_do_rx_poll 63939 4268457 us 66.758 us 818790.9 us
> > > >
> > > > 1Mbit:
> > > > Function Hit Time Avg s^2
> > > > -------- --- ---- --- ---
> > > > c_can_do_rx_poll 69489 30049498 us 432.435 us 9271851 us
> > > > With patch:
> > > > c_can_do_rx_poll 103034 24220362 us 235.071 us 6016656 us
> []
> > Yes I just measured the timings again:
> []
> > ./perf_can_test.sh 125000 30
> []
> > c_can_do_rx_poll 63941 3764057 us 58.867 us 776162.2 us
>
> Good, it's slightly faster still.
>
> > ./perf_can_test.sh 1000000 30
> []
> > c_can_do_rx_poll 207109 24322185 us 117.436 us 171469047 us
> []
> > It is interesting that the number of hits for c_can_do_rx_poll is twice as much
> > as it was with find_next_bit.
>
> How is this possible? Any idea?
Perhaps the can core received more messages in the previous patch
version while being in the poll function. This way it can handle more
messages without a new interrupt/poll call.
The new patch is faster so it does not receive as many new messages as
the old one, leading to more interrupts and less handled messages per
poll call.
Regards,
Markus Pargmann
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2013-10-30 7:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 8:27 [PATCH v2] can: c_can: Speed up rx_poll function Markus Pargmann
2013-10-29 8:31 ` Joe Perches
[not found] ` <1383035688.2713.2.camel@joe-AO722>
2013-10-29 8:58 ` Markus Pargmann
2013-10-29 16:24 ` Joe Perches
2013-10-30 7:54 ` Markus Pargmann [this message]
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=20131030075446.GE20839@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=joe@perches.com \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.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).