From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM cortex A9 performance issue
Date: Fri, 8 Jul 2011 14:33:15 +0100 [thread overview]
Message-ID: <20110708133315.GB2115@arm.com> (raw)
In-Reply-To: <CAE_nTV7PuEJx0WJKCtbGU-4HjEBzFxPRmPLue1toktS27Htbzg@mail.gmail.com>
On Fri, Jul 08, 2011 at 05:08:38PM +0530, rd bairva wrote:
> Now i have modified a source a little bit. Now I am doing a pingpong
> using msgsnd and msgrcv. using this I am getting 40000req/sec and 55%
> CPU usage.
> In another version I have taken the same lock in both the processes to
> ensure same thread is unlocking the mutex. But CPU usage is 100%.
> Shouldn't be the behaviour 50%.
Possibly. Do you see that behaviour on all platforms, or just A9?
>
> algo
> msgsnd/msgrcv version.
>
> Process1
> shared memory counter++
> msgsnd1
> msgrcv 2
>
> Process2
> msgrcv 1
> shared memory counter--
> msgsnd2
>
> Mutex version:
> Process 1
>
> mutex1
> c++
> unlock_mutex1
>
> Process 2
> mutex1
> c++
> unlock_mutex1
If there is some overhead outside the critical section, then the two threads
are likely to end up synchronised in such a way that this hides some or all of
the latency of acquiring the lock. So I'd expect a CPU load somewhere between
50% and 100%, though I'd be a bit surprised if all the latency is hidden.
If you don't check or wait for the counter increment, the same thread may
repeatedly take the lock of course, without ever waiting. If that happens,
you would see 100% load. This probably can't happen with the msgsnd/msgrcv
version.
Your results from msgsnd/msgrcv also suggest that the hidden message
receive latency and other system overheads account for something like
of the total CPU load for that code, which sounds plausible.
Can you attach your new code?
Cheers
---Dave
next prev parent reply other threads:[~2011-07-08 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 9:18 ARM cortex A9 performance issue rd bairva
2011-07-07 15:27 ` Dave Martin
2011-07-08 11:38 ` rd bairva
2011-07-08 13:33 ` Dave Martin [this message]
2011-07-11 8:26 ` rd bairva
2011-07-11 17:00 ` Dave Martin
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=20110708133315.GB2115@arm.com \
--to=dave.martin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).