From: "Li,Rongqing" <lirongqing@baidu.com>
To: Thomas Gleixner <tglx@linutronix.de>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"rafael@kernel.org" <rafael@kernel.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"peterz@infradead.org" <peterz@infradead.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"jpoimboe@kernel.org" <jpoimboe@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: RE: [PATCH] cpuidle-haltpoll: Disable kvm guest polling when mwait_idle is used
Date: Wed, 7 Dec 2022 03:45:03 +0000 [thread overview]
Message-ID: <bd15822f364145228de8ad83a38c9d26@baidu.com> (raw)
In-Reply-To: <87mt80g2fp.ffs@tglx>
> -----Original Message-----
> From: Thomas Gleixner <tglx@linutronix.de>
> Sent: Tuesday, December 6, 2022 8:08 PM
> To: Rafael J. Wysocki <rafael@kernel.org>; Li,Rongqing <lirongqing@baidu.com>
> Cc: mingo@redhat.com; bp@alien8.de; dave.hansen@linux.intel.com;
> x86@kernel.org; rafael@kernel.org; daniel.lezcano@linaro.org;
> peterz@infradead.org; akpm@linux-foundation.org; tony.luck@intel.com;
> jpoimboe@kernel.org; linux-kernel@vger.kernel.org; linux-pm@vger.kernel.org
> Subject: Re: [PATCH] cpuidle-haltpoll: Disable kvm guest polling when
> mwait_idle is used
>
> On Tue, Dec 06 2022 at 12:59, Rafael J. Wysocki wrote:
> > On Tue, Dec 6, 2022 at 7:43 AM <lirongqing@baidu.com> wrote:
> >>
> >> +bool is_mwait_idle(void)
> >> +{
> >> + return x86_idle == mwait_idle; }
> >> +EXPORT_SYMBOL_GPL(is_mwait_idle);
>
> No, this is just another adhoc check, which scratches ONE particular itch.
>
> >> @@ -111,6 +112,9 @@ static int __init haltpoll_init(void)
> >> if (!kvm_para_available() || !haltpoll_want())
> >> return -ENODEV;
> >>
> >> + if (is_mwait_idle())
> >> + return -ENODEV;
> >> +
> >
> > So perhaps you could make default_enter_idle() be a bit more careful
> > about what it calls as the "default idle" routine?
>
> Correct. arch_cpu_idle() is the one which should be called.
>
Greats, using arch_cpu_idle() can get best latency,
Before change, "sockperf ping-pong -i 127.0.0.1 -p 20001 --tcp " latency is:
sockperf: Summary: Latency is 6.245 usec
this patch, disable cpuidle-haltpoll
sockperf: Summary: Latency is 4.671 usec
using arch_cpu_idle() in default_enter_idle()
sockperf: Summary: Latency is 4.285 usec
thanks
-LiRongQing
> Thanks,
>
> tglx
next prev parent reply other threads:[~2022-12-07 4:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 6:43 [PATCH] cpuidle-haltpoll: Disable kvm guest polling when mwait_idle is used lirongqing
2022-12-06 11:59 ` Rafael J. Wysocki
2022-12-06 12:08 ` Thomas Gleixner
2022-12-07 3:45 ` Li,Rongqing [this message]
2022-12-07 10:49 ` Li,Rongqing
2022-12-07 11:41 ` Thomas Gleixner
2022-12-07 12:18 ` Li,Rongqing
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=bd15822f364145228de8ad83a38c9d26@baidu.com \
--to=lirongqing@baidu.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.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