From: Mukesh Ojha <mojha@codeaurora.org>
To: lkml <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Jiri Olsa <jolsa@redhat.com>,
mingo@redhat.com, acme@kernel.org
Subject: Re: [PATCH RESEND V4 0/1] perf: Add CPU hotplug support for events
Date: Fri, 26 Jul 2019 14:36:29 +0530 [thread overview]
Message-ID: <ce9626af-7f11-a556-1281-267b9f4422b4@codeaurora.org> (raw)
In-Reply-To: <8becbdff-6924-29d8-304a-8382e8fdb2d3@codeaurora.org>
Hi All,
Can you please review this ?
Thanks,
Mukesh
On 6/24/2019 2:31 PM, Mukesh Ojha wrote:
> Friendly ping.
>
> On 6/18/2019 7:16 PM, Mukesh Ojha wrote:
>> The embedded world, specifically Android mobile SoCs, rely on CPU
>> hotplugs to manage power and thermal constraints. These hotplugs
>> can happen at a very rapid pace. Adjacently, they also relies on
>> many perf event counters for its management. Therefore, there is
>> a need to preserve these events across hotplugs.
>>
>> In such a scenario, a perf client (kernel or user-space) can create
>> events even when the CPU is offline. If the CPU comes online during
>> the lifetime of the event, the registered event can start counting
>> spontaneously. As an extension to this, the events' count can also
>> be preserved across CPU hotplugs. This takes the burden off of the
>> clients to monitor the state of the CPU.
>>
>> The tests were conducted on arm64 device.
>> /* CPU-1 is offline: Event created when CPU1 is offline */
>>
>> / # cat /sys/devices/system/cpu/cpu1/online
>> 1
>> / # echo 0 > /sys/devices/system/cpu/cpu1/online
>>
>> Test used for testing
>> #!/bin/sh
>>
>> chmod +x *
>>
>> # Count the cycles events on cpu-1 for every 200 ms
>> ./perf stat -e cycles -I 200 -C 1 &
>>
>> # Make the CPU-1 offline and online continuously
>> while true; do
>> sleep 2
>> echo 0 > /sys/devices/system/cpu/cpu1/online
>> sleep 2
>> echo 1 > /sys/devices/system/cpu/cpu1/online
>> done
>>
>> Results:
>> / # ./test.sh
>> # time counts unit events
>> 0.200145885 <not counted> cycles
>> 0.410115208 <not counted> cycles
>> 0.619922551 <not counted> cycles
>> 0.829904635 <not counted> cycles
>> 1.039751614 <not counted> cycles
>> 1.249547603 <not counted> cycles
>> 1.459228280 <not counted> cycles
>> 1.665606561 <not counted> cycles
>> 1.874981926 <not counted> cycles
>> 2.084297811 <not counted> cycles
>> 2.293471249 <not counted> cycles
>> 2.503231561 <not counted> cycles
>> 2.712993332 <not counted> cycles
>> 2.922744478 <not counted> cycles
>> 3.132502186 <not counted> cycles
>> 3.342255050 <not counted> cycles
>> 3.552010102 <not counted> cycles
>> 3.761760363 <not counted> cycles
>>
>> /* CPU-1 made online: Event started counting */
>>
>> 3.971459269 1925429 cycles
>> 4.181325206 19391145 cycles
>> 4.391074164 113894 cycles
>> 4.599130519 3150152 cycles
>> 4.805564737 487122 cycles
>> 5.015164581 247533 cycles
>> 5.224764529 103622 cycles
>> # time counts unit events
>> 5.434360831 238179 cycles
>> 5.645293799 238895 cycles
>> 5.854909320 367543 cycles
>> 6.064487966 2383428 cycles
>>
>> /* CPU-1 made offline: counting stopped
>>
>> 6.274289476 <not counted> cycles
>> 6.483493903 <not counted> cycles
>> 6.693202705 <not counted> cycles
>> 6.902956195 <not counted> cycles
>> 7.112714268 <not counted> cycles
>> 7.322465570 <not counted> cycles
>> 7.532222340 <not counted> cycles
>> 7.741975830 <not counted> cycles
>> 7.951686246 <not counted> cycles
>>
>> /* CPU-1 made online: Event started counting
>>
>> 8.161469892 22040750 cycles
>> 8.371219528 114977 cycles
>> 8.580979111 259952 cycles
>> 8.790757132 444661 cycles
>> 9.000559215 248512 cycles
>> 9.210385256 246590 cycles
>> 9.420187704 243819 cycles
>> 9.630052287 7102438 cycles
>> 9.839848225 337454 cycles
>> 10.049645048 644072 cycles
>> 10.259476246 1855410 cycles
>>
>> Mukesh Ojha (1):
>> perf: event preserve and create across cpu hotplug
>>
>> include/linux/perf_event.h | 1 +
>> kernel/events/core.c | 122
>> +++++++++++++++++++++++++++++----------------
>> 2 files changed, 79 insertions(+), 44 deletions(-)
>>
prev parent reply other threads:[~2019-07-26 9:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 13:39 [PATCH V2 " Mukesh Ojha
2019-05-31 13:39 ` [PATCH V2 1/1] perf: event preserve and create across cpu hotplug Mukesh Ojha
2019-06-03 17:53 ` Jiri Olsa
2019-06-04 14:09 ` Mukesh Ojha
2019-06-12 10:57 ` [PATCH V3] " Mukesh Ojha
2019-06-18 8:54 ` [PATCH V4] " Mukesh Ojha
2019-06-18 12:23 ` Peter Zijlstra
2019-06-18 13:40 ` Mukesh Ojha
2019-06-18 13:46 ` [PATCH RESEND V4 0/1] perf: Add CPU hotplug support for events Mukesh Ojha
2019-06-18 13:46 ` [PATCH RESEND V4 1/1] perf: event preserve and create across cpu hotplug Mukesh Ojha
2019-07-02 8:25 ` Mukesh Ojha
2019-06-24 9:01 ` [PATCH RESEND V4 0/1] perf: Add CPU hotplug support for events Mukesh Ojha
2019-07-26 9:06 ` Mukesh Ojha [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=ce9626af-7f11-a556-1281-267b9f4422b4@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@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
all inboxes | Powered by JetHome®