From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>,
Tomasz Figa <t.figa@samsung.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Chirantan Ekbote <chirantan@chromium.org>,
David Riley <davidriley@chromium.org>,
Olof Johansson <olof@lixom.net>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] clocksource: exynos_mct: Fix ftrace
Date: Mon, 16 Jun 2014 10:52:12 +0200 [thread overview]
Message-ID: <539EB03C.5080100@linaro.org> (raw)
In-Reply-To: <CAD=FV=XA09XawT-fxAm2tTMw4kZ=7RHceXuww2y6q+zMV71pew@mail.gmail.com>
On 06/16/2014 06:40 AM, Doug Anderson wrote:
> Daniel,
>
> On Sun, Jun 15, 2014 at 2:18 PM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> On 06/04/2014 07:30 PM, Doug Anderson wrote:
>>>
>>> In (93bfb76 clocksource: exynos_mct: register sched_clock callback) we
>>> supported using the MCT as a scheduler clock. We properly marked
>>> exynos4_read_sched_clock() as notrace. However, we then went and
>>> called another function that _wasn't_ notrace. That means if you do:
>>>
>>> cd /sys/kernel/debug/tracing/
>>> echo function_graph > current_tracer
>>>
>>> You'll get a crash.
>>>
>>> Fix this (but still let other readers of the MCT be trace-enabled) by
>>> adding an extra function. It's important to keep other users of MCT
>>> traceable because the MCT is actually quite slow.
>>
>>
>>
>> Hi Doug,
>>
>> could you elaborate ? I don't get the 'because the MCT ... slow'
>
> Sorry, I was trying to avoid duplication in the series and it's more
> obvious when you look at parts 2 and 3 of the series. ;)
>
> Doing the math (please correct any miscalculations) using the numbers
> from the other patches: You can see that the existing code takes
> 1323852 us for 1000000 gettimeofday in userspace. The fastest
> implementation (just shaving to a 32-bit timer) gets us as fast as
> ~1000000 us for 1000000 gettimeofday in userspace.
>
> From profiling, I believe that gettimeofday from userspace is about
> 50% overhead (system call, multiplication, copies, etc) and about 50%
> MCT read. That means that the fastest you can possibly do an MCT read
> is in .5us or 500ns.
>
> I believe an A15 has something like 1 or 2 cycles per instruction. If
> it were 2 cycles per instruction, it can execute a normal instruction
> on a 2GHz machine in .5ns. That means we can execute 1000 normal
> instructions in the time it takes to do a since MCT access.
>
> ...so I guess that's what I'd call slow. ;) What do you think? I
> know that the MCT read shows up in whole system profiles of
> gettimeofday.
Hi Dough,
thanks for the explanation. I still don't get why it is important to
keep others users of mct traceable because it is quite slow ? May be it
is what you explained here, but I miss the connection between 'the other
users' <-> 'traceable' <-> 'because slow'.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
WARNING: multiple messages have this Message-ID (diff)
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] clocksource: exynos_mct: Fix ftrace
Date: Mon, 16 Jun 2014 10:52:12 +0200 [thread overview]
Message-ID: <539EB03C.5080100@linaro.org> (raw)
In-Reply-To: <CAD=FV=XA09XawT-fxAm2tTMw4kZ=7RHceXuww2y6q+zMV71pew@mail.gmail.com>
On 06/16/2014 06:40 AM, Doug Anderson wrote:
> Daniel,
>
> On Sun, Jun 15, 2014 at 2:18 PM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> On 06/04/2014 07:30 PM, Doug Anderson wrote:
>>>
>>> In (93bfb76 clocksource: exynos_mct: register sched_clock callback) we
>>> supported using the MCT as a scheduler clock. We properly marked
>>> exynos4_read_sched_clock() as notrace. However, we then went and
>>> called another function that _wasn't_ notrace. That means if you do:
>>>
>>> cd /sys/kernel/debug/tracing/
>>> echo function_graph > current_tracer
>>>
>>> You'll get a crash.
>>>
>>> Fix this (but still let other readers of the MCT be trace-enabled) by
>>> adding an extra function. It's important to keep other users of MCT
>>> traceable because the MCT is actually quite slow.
>>
>>
>>
>> Hi Doug,
>>
>> could you elaborate ? I don't get the 'because the MCT ... slow'
>
> Sorry, I was trying to avoid duplication in the series and it's more
> obvious when you look at parts 2 and 3 of the series. ;)
>
> Doing the math (please correct any miscalculations) using the numbers
> from the other patches: You can see that the existing code takes
> 1323852 us for 1000000 gettimeofday in userspace. The fastest
> implementation (just shaving to a 32-bit timer) gets us as fast as
> ~1000000 us for 1000000 gettimeofday in userspace.
>
> From profiling, I believe that gettimeofday from userspace is about
> 50% overhead (system call, multiplication, copies, etc) and about 50%
> MCT read. That means that the fastest you can possibly do an MCT read
> is in .5us or 500ns.
>
> I believe an A15 has something like 1 or 2 cycles per instruction. If
> it were 2 cycles per instruction, it can execute a normal instruction
> on a 2GHz machine in .5ns. That means we can execute 1000 normal
> instructions in the time it takes to do a since MCT access.
>
> ...so I guess that's what I'd call slow. ;) What do you think? I
> know that the MCT read shows up in whole system profiles of
> gettimeofday.
Hi Dough,
thanks for the explanation. I still don't get why it is important to
keep others users of mct traceable because it is quite slow ? May be it
is what you explained here, but I miss the connection between 'the other
users' <-> 'traceable' <-> 'because slow'.
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2014-06-16 8:52 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 17:30 [PATCH 1/3] clocksource: exynos_mct: Fix ftrace Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-04 17:30 ` [PATCH 2/3] clocksource: exynos_mct: cache mct upper count Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-05 7:55 ` Vincent Guittot
2014-06-05 7:55 ` Vincent Guittot
2014-06-05 17:14 ` Doug Anderson
2014-06-05 17:14 ` Doug Anderson
2014-06-04 17:30 ` [PATCH 3/3] clocksource: exynos_mct: Optimize register reads with ldmia Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-04 17:30 ` Doug Anderson
2014-06-04 18:05 ` Thomas Gleixner
2014-06-04 18:05 ` Thomas Gleixner
2014-06-04 18:49 ` Doug Anderson
2014-06-04 18:49 ` Doug Anderson
2014-06-05 11:18 ` Tomasz Figa
2014-06-05 11:18 ` Tomasz Figa
2014-06-05 18:21 ` Doug Anderson
2014-06-05 18:21 ` Doug Anderson
2014-06-12 16:53 ` Doug Anderson
2014-06-12 16:53 ` Doug Anderson
2014-06-15 21:18 ` [PATCH 1/3] clocksource: exynos_mct: Fix ftrace Daniel Lezcano
2014-06-15 21:18 ` Daniel Lezcano
2014-06-16 4:40 ` Doug Anderson
2014-06-16 4:40 ` Doug Anderson
2014-06-16 8:52 ` Daniel Lezcano [this message]
2014-06-16 8:52 ` Daniel Lezcano
2014-06-16 16:35 ` Doug Anderson
2014-06-16 16:35 ` Doug Anderson
2014-06-17 12:13 ` Daniel Lezcano
2014-06-17 12:13 ` Daniel Lezcano
2014-06-19 17:07 ` Doug Anderson
2014-06-19 17:07 ` Doug Anderson
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=539EB03C.5080100@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=chirantan@chromium.org \
--cc=davidriley@chromium.org \
--cc=dianders@chromium.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=olof@lixom.net \
--cc=t.figa@samsung.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.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 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.