From: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: "rafael@kernel.org" <rafael@kernel.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"joao.m.martins@oracle.com" <joao.m.martins@oracle.com>
Subject: Re: [PATCH v2] cpuidle: haltpoll: Add trace points for guest_halt_poll_ns grow/shrink
Date: Fri, 27 May 2022 00:42:56 +0000 [thread overview]
Message-ID: <043BFE84-A38F-4301-965E-C3AA762AB464@nutanix.com> (raw)
In-Reply-To: <Yo5n8TsSuU9/IxEh@fuller.cnet>
Hi Marcelo
> On May 26, 2022, at 2:31, Marcelo Tosatti <mtosatti@redhat.com> wrote:
>
> On Mon, May 23, 2022 at 11:53:32PM +0000, Eiichi Tsukata wrote:
>> Add trace points as are implemented in KVM host halt polling.
>> This helps tune guest halt polling params.
>>
>> Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
>> ---
>> drivers/cpuidle/governors/haltpoll.c | 15 ++++++++-----
>> include/trace/events/power.h | 33 ++++++++++++++++++++++++++++
>> 2 files changed, 43 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c
>> index cb2a96eafc02..a5b6ad32956c 100644
>> --- a/drivers/cpuidle/governors/haltpoll.c
>> +++ b/drivers/cpuidle/governors/haltpoll.c
>> @@ -19,6 +19,7 @@
>> #include <linux/sched.h>
>> #include <linux/module.h>
>> #include <linux/kvm_para.h>
>> +#include <trace/events/power.h>
>>
>> static unsigned int guest_halt_poll_ns __read_mostly = 200000;
>> module_param(guest_halt_poll_ns, uint, 0644);
>> @@ -77,13 +78,16 @@ static int haltpoll_select(struct cpuidle_driver *drv,
>>
>> static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns)
>> {
>> - unsigned int val;
>> + unsigned int val, old;
>>
>> - /* Grow cpu_halt_poll_us if
>> - * cpu_halt_poll_us < block_ns < guest_halt_poll_us
>> + val = dev->poll_limit_ns;
>> + old = val;
>> +
>> + /* Grow poll_limit_ns if
>> + * poll_limit_ns < block_ns < guest_halt_poll_ns
>> */
>> if (block_ns > dev->poll_limit_ns && block_ns <= guest_halt_poll_ns) {
>> - val = dev->poll_limit_ns * guest_halt_poll_grow;
>> + val *= guest_halt_poll_grow;
>>
>> if (val < guest_halt_poll_grow_start)
>> val = guest_halt_poll_grow_start;
>> @@ -91,16 +95,17 @@ static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns)
>> val = guest_halt_poll_ns;
>>
>
> Can do it before the assignment:
>
> trace_guest_halt_poll_ns_grow(val, dev->poll_limit_ns);
Sure. Will fix it in v4.
Thanks
Eiichi
prev parent reply other threads:[~2022-05-27 0:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 23:53 Eiichi Tsukata
2022-05-25 16:02 ` Steven Rostedt
2022-05-26 0:02 ` Eiichi Tsukata
2022-05-25 17:31 ` Marcelo Tosatti
2022-05-27 0:42 ` Eiichi Tsukata [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=043BFE84-A38F-4301-965E-C3AA762AB464@nutanix.com \
--to=eiichi.tsukata@nutanix.com \
--cc=daniel.lezcano@linaro.org \
--cc=joao.m.martins@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.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®