From: Yang Zhang <yang.zhang.wz@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: x86@kernel.org, corbet@lwn.net, tony.luck@intel.com,
bp@alien8.de, peterz@infradead.org, mchehab@kernel.org,
akpm@linux-foundation.org, krzk@kernel.org, jpoimboe@redhat.com,
luto@kernel.org, borntraeger@de.ibm.com, thgarnie@google.com,
rgerst@gmail.com, minipli@googlemail.com,
douly.fnst@cn.fujitsu.com, nicstange@gmail.com,
fweisbec@gmail.com, dvlasenk@redhat.com, bristot@redhat.com,
yamada.masahiro@socionext.com, mika.westerberg@linux.intel.com,
yu.c.chen@intel.com, aaron.lu@intel.com, rostedt@goodmis.org,
me@kylehuey.com, len.brown@intel.com, prarit@redhat.com,
hidehiro.kawai.ez@hitachi.com, fengtiantian@huawei.com,
pmladek@suse.com, jeyu@redhat.com, Larry.Finger@lwfinger.net,
zijun_hu@htc.com, luisbg@osg.samsung.com,
johannes.berg@intel.com, niklas.soderlund+renesas@ragnatech.se,
zlpnobody@gmail.com, adobriyan@gmail.com,
fgao@48lvckh6395k16k5.yundunddos.com, ebiederm@xmission.com,
subashab@codeaurora.org, arnd@arndb.de, matt@codeblueprint.co.uk,
mgorman@techsingularity.net, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, linux-edac@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] x86/idle: use dynamic halt poll
Date: Fri, 23 Jun 2017 11:58:15 +0800 [thread overview]
Message-ID: <2245bef7-b668-9265-f3f8-3b63d71b1033@gmail.com> (raw)
In-Reply-To: <4444ffc8-9e7b-5bd2-20da-af422fe834cc@redhat.com>
On 2017/6/22 19:51, Paolo Bonzini wrote:
>
>
> On 22/06/2017 13:22, root wrote:
>> ==============================================================
>>
>> +poll_grow: (X86 only)
>> +
>> +This parameter is multiplied in the grow_poll_ns() to increase the poll time.
>> +By default, the values is 2.
>> +
>> +==============================================================
>> +poll_shrink: (X86 only)
>> +
>> +This parameter is divided in the shrink_poll_ns() to reduce the poll time.
>> +By default, the values is 2.
>
> Even before starting the debate on whether this is a good idea or a bad
> idea, KVM reduces the polling value to the minimum (10 us) by default
I noticed it. It looks like the logic inside KVM is more reasonable. I
will do more testing to compare the two.
> when polling fails. Also, it shouldn't be bound to
> CONFIG_HYPERVISOR_GUEST, since there's nothing specific to virtual
> machines here.
Yes. The original idea to use CONFIG_HYPERVISOR_GUEST because this
mechanism will only helpful inside VM. But as Thomas mentioned on other
thread it is wrong to use it since most distribution kernel will set it
to yes and still affect the bare metal. I will integrate it with
paravirtualizaion part as you suggested in below.
>
> Regarding the good/bad idea part, KVM's polling is made much more
> acceptable by single_task_running(). At least you need to integrate it
> with paravirtualization. If the VM is scheduled out, you shrink the
> polling period. There is already vcpu_is_preempted for this, it is used
> by mutexes.
I have considered single_task_running() before. But since there is no
such paravirtual interface currently and i am not sure whether it is a
information leak from host if introducing such interface, so i didn't do
it. Do you mean vcpu_is_preempted can do the same thing? I check the
code and seems it only tells whether the VCPU is scheduled out or not
which cannot satisfy the needs.
>
> Paolo
>
--
Yang
Alibaba Cloud Computing
WARNING: multiple messages have this Message-ID (diff)
From: Yang Zhang <yang.zhang.wz@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: x86@kernel.org, corbet@lwn.net, tony.luck@intel.com,
bp@alien8.de, peterz@infradead.org, mchehab@kernel.org,
akpm@linux-foundation.org, krzk@kernel.org, jpoimboe@redhat.com,
luto@kernel.org, borntraeger@de.ibm.com, thgarnie@google.com,
rgerst@gmail.com, minipli@googlemail.com,
douly.fnst@cn.fujitsu.com, nicstange@gmail.com,
fweisbec@gmail.com, dvlasenk@redhat.com, bristot@redhat.com,
yamada.masahiro@socionext.com, mika.westerberg@linux.intel.com,
yu.c.chen@intel.com, aaron.lu@intel.com, rostedt@goodmis.org,
me@kylehuey.com, len.brown@intel.com, prarit@redhat.com,
hidehiro.kawai.ez@hitachi.com, fengtiantian@huawei.com,
pmladek@suse.com, jeyu@redhat.com, Larry.Finger@lwfinger.net,
zijun_hu@htc.com, luisbg@osg.samsung.com,
johannes.berg@intel.com, niklas.soderlund+renesas@ragnatech.se,
zlpnobody@gmail.com, adobriyan@gmail.com, fgao@ikuai8.com,
ebiederm@xmission.com, subashab@codeaurora.org, arnd@arndb.de,
matt@codeblueprint.co.uk, mgorman@techsingularity.net,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-edac@vger.kernel.org, kvm@vger.kernel.org
Subject: [2/2] x86/idle: use dynamic halt poll
Date: Fri, 23 Jun 2017 11:58:15 +0800 [thread overview]
Message-ID: <2245bef7-b668-9265-f3f8-3b63d71b1033@gmail.com> (raw)
On 2017/6/22 19:51, Paolo Bonzini wrote:
>
>
> On 22/06/2017 13:22, root wrote:
>> ==============================================================
>>
>> +poll_grow: (X86 only)
>> +
>> +This parameter is multiplied in the grow_poll_ns() to increase the poll time.
>> +By default, the values is 2.
>> +
>> +==============================================================
>> +poll_shrink: (X86 only)
>> +
>> +This parameter is divided in the shrink_poll_ns() to reduce the poll time.
>> +By default, the values is 2.
>
> Even before starting the debate on whether this is a good idea or a bad
> idea, KVM reduces the polling value to the minimum (10 us) by default
I noticed it. It looks like the logic inside KVM is more reasonable. I
will do more testing to compare the two.
> when polling fails. Also, it shouldn't be bound to
> CONFIG_HYPERVISOR_GUEST, since there's nothing specific to virtual
> machines here.
Yes. The original idea to use CONFIG_HYPERVISOR_GUEST because this
mechanism will only helpful inside VM. But as Thomas mentioned on other
thread it is wrong to use it since most distribution kernel will set it
to yes and still affect the bare metal. I will integrate it with
paravirtualizaion part as you suggested in below.
>
> Regarding the good/bad idea part, KVM's polling is made much more
> acceptable by single_task_running(). At least you need to integrate it
> with paravirtualization. If the VM is scheduled out, you shrink the
> polling period. There is already vcpu_is_preempted for this, it is used
> by mutexes.
I have considered single_task_running() before. But since there is no
such paravirtual interface currently and i am not sure whether it is a
information leak from host if introducing such interface, so i didn't do
it. Do you mean vcpu_is_preempted can do the same thing? I check the
code and seems it only tells whether the VCPU is scheduled out or not
which cannot satisfy the needs.
>
> Paolo
>
WARNING: multiple messages have this Message-ID (diff)
From: Yang Zhang <yang.zhang.wz@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: x86@kernel.org, corbet@lwn.net, tony.luck@intel.com,
bp@alien8.de, peterz@infradead.org, mchehab@kernel.org,
akpm@linux-foundation.org, krzk@kernel.org, jpoimboe@redhat.com,
luto@kernel.org, borntraeger@de.ibm.com, thgarnie@google.com,
rgerst@gmail.com, minipli@googlemail.com,
douly.fnst@cn.fujitsu.com, nicstange@gmail.com,
fweisbec@gmail.com, dvlasenk@redhat.com, bristot@redhat.com,
yamada.masahiro@socionext.com, mika.westerberg@linux.intel.com,
yu.c.chen@intel.com, aaron.lu@intel.com, rostedt@goodmis.org,
me@kylehuey.com, len.brown@intel.com, prarit@redhat.com,
hidehiro.kawai.ez@hitachi.com, fengtiantian@huawei.com,
pmladek@suse.com, jeyu@redhat.com, Larry.Finger@lwfinger.net,
zijun_hu@htc.com, luisbg@osg.samsung.com,
johannes.berg@intel.com, niklas.soderlund+renesas@ragnatech.se
Subject: Re: [PATCH 2/2] x86/idle: use dynamic halt poll
Date: Fri, 23 Jun 2017 11:58:15 +0800 [thread overview]
Message-ID: <2245bef7-b668-9265-f3f8-3b63d71b1033@gmail.com> (raw)
In-Reply-To: <4444ffc8-9e7b-5bd2-20da-af422fe834cc@redhat.com>
On 2017/6/22 19:51, Paolo Bonzini wrote:
>
>
> On 22/06/2017 13:22, root wrote:
>> ==============================================================
>>
>> +poll_grow: (X86 only)
>> +
>> +This parameter is multiplied in the grow_poll_ns() to increase the poll time.
>> +By default, the values is 2.
>> +
>> +==============================================================
>> +poll_shrink: (X86 only)
>> +
>> +This parameter is divided in the shrink_poll_ns() to reduce the poll time.
>> +By default, the values is 2.
>
> Even before starting the debate on whether this is a good idea or a bad
> idea, KVM reduces the polling value to the minimum (10 us) by default
I noticed it. It looks like the logic inside KVM is more reasonable. I
will do more testing to compare the two.
> when polling fails. Also, it shouldn't be bound to
> CONFIG_HYPERVISOR_GUEST, since there's nothing specific to virtual
> machines here.
Yes. The original idea to use CONFIG_HYPERVISOR_GUEST because this
mechanism will only helpful inside VM. But as Thomas mentioned on other
thread it is wrong to use it since most distribution kernel will set it
to yes and still affect the bare metal. I will integrate it with
paravirtualizaion part as you suggested in below.
>
> Regarding the good/bad idea part, KVM's polling is made much more
> acceptable by single_task_running(). At least you need to integrate it
> with paravirtualization. If the VM is scheduled out, you shrink the
> polling period. There is already vcpu_is_preempted for this, it is used
> by mutexes.
I have considered single_task_running() before. But since there is no
such paravirtual interface currently and i am not sure whether it is a
information leak from host if introducing such interface, so i didn't do
it. Do you mean vcpu_is_preempted can do the same thing? I check the
code and seems it only tells whether the VCPU is scheduled out or not
which cannot satisfy the needs.
>
> Paolo
>
--
Yang
Alibaba Cloud Computing
next prev parent reply other threads:[~2017-06-23 3:58 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 11:22 [PATCH 0/2] x86/idle: add halt poll support root
2017-06-22 11:22 ` root
2017-06-22 11:22 ` [PATCH 1/2] x86/idle: add halt poll for halt idle root
2017-06-22 11:22 ` root
2017-06-22 11:22 ` [1/2] " Yang Zhang
2017-06-22 14:23 ` [PATCH 1/2] " Thomas Gleixner
2017-06-22 14:23 ` Thomas Gleixner
2017-06-22 14:23 ` [1/2] " Thomas Gleixner
2017-06-23 4:05 ` [PATCH 1/2] " Yang Zhang
2017-06-23 4:05 ` Yang Zhang
2017-06-23 4:05 ` [1/2] " Yang Zhang
2017-08-16 4:04 ` [PATCH 1/2] " Michael S. Tsirkin
2017-08-16 4:04 ` Michael S. Tsirkin
2017-08-16 4:04 ` [1/2] " Michael S. Tsirkin
2017-08-17 7:29 ` [PATCH 1/2] " Yang Zhang
2017-08-17 7:29 ` Yang Zhang
2017-08-17 7:29 ` [1/2] " Yang Zhang
2017-06-22 11:22 ` [PATCH 2/2] x86/idle: use dynamic halt poll root
2017-06-22 11:22 ` root
2017-06-22 11:22 ` [2/2] " Yang Zhang
2017-06-22 11:51 ` [PATCH 2/2] " Paolo Bonzini
2017-06-22 11:51 ` Paolo Bonzini
2017-06-22 11:51 ` [2/2] " Paolo Bonzini
2017-06-23 3:58 ` Yang Zhang [this message]
2017-06-23 3:58 ` [PATCH 2/2] " Yang Zhang
2017-06-23 3:58 ` [2/2] " Yang Zhang
2017-06-27 11:22 ` [PATCH 2/2] " Yang Zhang
2017-06-27 11:22 ` Yang Zhang
2017-06-27 11:22 ` [2/2] " Yang Zhang
2017-06-27 12:07 ` [PATCH 2/2] " Paolo Bonzini
2017-06-27 12:07 ` Paolo Bonzini
2017-06-27 12:07 ` [2/2] " Paolo Bonzini
2017-06-27 12:23 ` [PATCH 2/2] " Wanpeng Li
2017-06-27 12:23 ` Wanpeng Li
2017-06-27 12:23 ` [2/2] " Wanpeng Li
2017-06-27 12:28 ` [PATCH 2/2] " Paolo Bonzini
2017-06-27 12:28 ` Paolo Bonzini
2017-06-27 12:28 ` [2/2] " Paolo Bonzini
2017-06-27 13:40 ` [PATCH 2/2] " Radim Krčmář
2017-06-27 13:40 ` Radim Krčmář
2017-06-27 13:40 ` [2/2] " Radim Krčmář
2017-06-27 13:56 ` [PATCH 2/2] " Paolo Bonzini
2017-06-27 13:56 ` Paolo Bonzini
2017-06-27 13:56 ` [2/2] " Paolo Bonzini
2017-06-27 14:22 ` [PATCH 2/2] " Radim Krčmář
2017-06-27 14:22 ` Radim Krčmář
2017-06-27 14:22 ` [2/2] " Radim Krčmář
2017-06-27 14:26 ` [PATCH 2/2] " Paolo Bonzini
2017-06-27 14:26 ` Paolo Bonzini
2017-06-27 14:26 ` [2/2] " Paolo Bonzini
2017-07-03 9:28 ` [PATCH 2/2] " Yang Zhang
2017-07-03 9:28 ` Yang Zhang
2017-07-03 9:28 ` [2/2] " Yang Zhang
2017-07-03 10:06 ` [PATCH 2/2] " Thomas Gleixner
2017-07-03 10:06 ` Thomas Gleixner
2017-07-03 10:06 ` [2/2] " Thomas Gleixner
2017-07-04 2:19 ` [PATCH 2/2] " Yang Zhang
2017-07-04 2:19 ` Yang Zhang
2017-07-04 2:19 ` [2/2] " Yang Zhang
2017-07-04 14:13 ` [PATCH 2/2] " Radim Krčmář
2017-07-04 14:13 ` Radim Krčmář
2017-07-04 14:13 ` [2/2] " Radim Krčmář
2017-07-04 14:50 ` [PATCH 2/2] " Thomas Gleixner
2017-07-04 14:50 ` Thomas Gleixner
2017-07-04 14:50 ` [2/2] " Thomas Gleixner
2017-07-13 11:49 ` [PATCH 2/2] " Yang Zhang
2017-07-13 11:49 ` Yang Zhang
2017-07-13 11:49 ` [2/2] " Yang Zhang
2017-07-14 9:37 ` [PATCH 2/2] " Alexander Graf
2017-07-14 9:37 ` Alexander Graf
2017-07-14 9:37 ` [2/2] " Alexander Graf
2017-07-17 9:26 ` [PATCH 2/2] " Yang Zhang
2017-07-17 9:26 ` Yang Zhang
2017-07-17 9:26 ` [2/2] " Yang Zhang
2017-07-17 9:54 ` [PATCH 2/2] " Alexander Graf
2017-07-17 9:54 ` Alexander Graf
2017-07-17 9:54 ` [2/2] " Alexander Graf
2017-07-17 12:50 ` [PATCH 2/2] " Yang Zhang
2017-07-17 12:50 ` Yang Zhang
2017-07-17 12:50 ` [2/2] " Yang Zhang
2017-07-04 22:28 ` [PATCH 2/2] " Wanpeng Li
2017-07-04 22:28 ` Wanpeng Li
2017-07-04 22:28 ` [2/2] " Wanpeng Li
2017-06-22 14:32 ` [PATCH 2/2] " Thomas Gleixner
2017-06-22 14:32 ` Thomas Gleixner
2017-06-22 14:32 ` [2/2] " Thomas Gleixner
2017-06-23 4:04 ` [PATCH 2/2] " Yang Zhang
2017-06-23 4:04 ` Yang Zhang
2017-06-23 4:04 ` [2/2] " Yang Zhang
2017-06-22 22:46 ` [PATCH 2/2] " kbuild test robot
2017-06-22 22:46 ` kbuild test robot
2017-06-22 22:46 ` [2/2] " kbuild test robot
2017-06-22 11:32 ` [PATCH 0/2] x86/idle: add halt poll support Yang Zhang
2017-06-22 11:32 ` Yang Zhang
2017-06-22 11:50 ` Wanpeng Li
2017-06-22 11:50 ` Wanpeng Li
2017-06-23 4:08 ` Yang Zhang
2017-06-23 4:08 ` Yang Zhang
2017-06-23 4:35 ` Wanpeng Li
2017-06-23 4:35 ` Wanpeng Li
2017-06-23 6:49 ` Yang Zhang
2017-06-23 6:49 ` Yang Zhang
2017-06-27 14:00 ` Radim Krčmář
2017-06-27 14:00 ` Radim Krčmář
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=2245bef7-b668-9265-f3f8-3b63d71b1033@gmail.com \
--to=yang.zhang.wz@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=aaron.lu@intel.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=borntraeger@de.ibm.com \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=corbet@lwn.net \
--cc=douly.fnst@cn.fujitsu.com \
--cc=dvlasenk@redhat.com \
--cc=ebiederm@xmission.com \
--cc=fengtiantian@huawei.com \
--cc=fgao@48lvckh6395k16k5.yundunddos.com \
--cc=fweisbec@gmail.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=hpa@zytor.com \
--cc=jeyu@redhat.com \
--cc=johannes.berg@intel.com \
--cc=jpoimboe@redhat.com \
--cc=krzk@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=len.brown@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luisbg@osg.samsung.com \
--cc=luto@kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mchehab@kernel.org \
--cc=me@kylehuey.com \
--cc=mgorman@techsingularity.net \
--cc=mika.westerberg@linux.intel.com \
--cc=mingo@redhat.com \
--cc=minipli@googlemail.com \
--cc=nicstange@gmail.com \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=rgerst@gmail.com \
--cc=rostedt@goodmis.org \
--cc=subashab@codeaurora.org \
--cc=tglx@linutronix.de \
--cc=thgarnie@google.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
--cc=yu.c.chen@intel.com \
--cc=zijun_hu@htc.com \
--cc=zlpnobody@gmail.com \
/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.