kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Wanpeng Li" <wanpengli@tencent.com>,
	"Jim Mattson" <jmattson@google.com>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	linux-pm@vger.kernel.org,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2] cpuidle-haltpoll: vcpu hotplug support
Date: Mon, 2 Sep 2019 11:48:06 +0100	[thread overview]
Message-ID: <5df5b2b1-11ce-9b1a-dd4a-8fe32e491543@oracle.com> (raw)
In-Reply-To: <20190829152714.GA15616@amt.cnet>

On 8/29/19 4:27 PM, Marcelo Tosatti wrote:
> On Thu, Aug 29, 2019 at 04:10:27PM +0100, Joao Martins wrote:
>> When cpus != maxcpus cpuidle-haltpoll will fail to register all vcpus
>> past the online ones and thus fail to register the idle driver.
>> This is because cpuidle_add_sysfs() will return with -ENODEV as a
>> consequence from get_cpu_device() return no device for a non-existing
>> CPU.
>>
>> Instead switch to cpuidle_register_driver() and manually register each
>> of the present cpus through cpuhp_setup_state() callback and future
>> ones that get onlined. This mimmics similar logic that intel_idle does.
>>
>> Fixes: fa86ee90eb11 ("add cpuidle-haltpoll driver")
>> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> ---
>> v2:
>> * move cpus_read_unlock() right after unregistering all cpuidle_devices;
>> (Marcello Tosatti)
>> * redundant usage of cpuidle_unregister() when only
>> cpuidle_unregister_driver() suffices; (Marcelo Tosatti)
>> * cpuhp_setup_state() returns a state (> 0) on success with CPUHP_AP_ONLINE_DYN
>> thus we set @ret to 0

[ ... ]

> 
> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
Thanks!

Meanwhile upon re-reading cpuhp_setup_state() I found out the teardown/offlining
and haltpoll_uninit() could be a bit simplified. So I sent out a new version[0],
but didn't add your Rb because there's was some very slight functional changes.

[0] https://lore.kernel.org/kvm/20190902104031.9296-1-joao.m.martins@oracle.com/

	Joao

  reply	other threads:[~2019-09-02 10:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 15:10 [PATCH v2] cpuidle-haltpoll: vcpu hotplug support Joao Martins
2019-08-29 15:27 ` Marcelo Tosatti
2019-09-02 10:48   ` Joao Martins [this message]
2019-08-29 17:16 ` Is: Default governor regardless of cpuidle driver Was: " Joao Martins
2019-08-29 17:23   ` Marcelo Tosatti
2019-09-02 21:55     ` Rafael J. Wysocki
2019-09-03 10:13       ` Joao Martins
2019-08-29 17:42   ` Daniel Lezcano
2019-08-29 18:07     ` Joao Martins
2019-08-29 18:28       ` Daniel Lezcano
2019-08-29 19:11         ` Default governor regardless of cpuidle driver Joao Martins
2019-08-29 20:22           ` Daniel Lezcano
2019-08-29 21:12             ` Joao Martins
2019-08-29 21:51               ` Daniel Lezcano
2019-08-30 11:07                 ` Joao Martins
2019-09-02 21:58                   ` Rafael J. Wysocki

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=5df5b2b1-11ce-9b1a-dd4a-8fe32e491543@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).