All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Conrad Wood <linux-kvm@conradwood.net>
Cc: "Kevin O'Connor" <kevin@koconnor.net>, kvm@vger.kernel.org
Subject: Re: cpu hotplug
Date: Sun, 19 Sep 2010 16:36:11 +0200	[thread overview]
Message-ID: <20100919143611.GW3008@redhat.com> (raw)
In-Reply-To: <1284905270.9521.221.camel@frechmops.schnuffi.conrad.localdomain>

On Sun, Sep 19, 2010 at 04:07:50PM +0200, Conrad Wood wrote:
> On Sun, 2010-09-19 at 15:50 +0200, Gleb Natapov wrote:
> > On Sun, Sep 19, 2010 at 09:46:21AM -0400, Kevin O'Connor wrote:
> > > On Sun, Sep 19, 2010 at 03:40:45PM +0200, Gleb Natapov wrote:
> > > > halted state is not the way to check for whether cpu is online or
> > > > offline. cpu may be online but executing hlt instruction so 
> > > > its state will be halted, but cpu itself is online. Actually with kvm
> > > > today you are not able to check that cpu is offline if it was ever
> > > > online. Query a guest for cpu status.
> > > 
> > > In that regard, "info cpus" does seem to work - as it only shows me
> > > the cpus that have ever been online.  Ejecting a cpu in the guest does
> > > not remove it from "info cpus", but then, I don't think kvm does
> > > remove it from being available after an eject.
> > > 
> > Exactly. That what I meant by "Actually with kvm today you are not able
> > to check that cpu is offline if it was ever online". So if cpu was never
> > online it is easy to check that it is offline (it will not be reported
> > by "info cpus"). But if it was inserted and then ejected it will still
> > be present in "info cpus", but not used by a guest OS.
> > 
> > --
> > 			Gleb.
> > 
> 
> 1) Thanks for clarifying "online" vs "halted" - that makes sense and is
> probably part of what confused me. I need to get the "online/offline"
> status of cpus, not if they are halted or not. I understand this is
> currently not possible with kvm. As I have no direct control over the
> guest OS, I do however need a solution on the host. Any clues how this
> could be implemented would be much appreciated.
> This is important to me.
Lets establish some terminology to understand each other better:
Lets use CPU inserted/ejected to refer to cpu being available/not
available to a guest.
Lest use CPU online/offline to refer to cpu been used by a guest OS.

CPU hot-plug works like this:
  cpu is inserted (plugged into cpu socket on MB)
  guest OS is notifies through ACPI
  guest OS starts to use newly added CPU (makes it online)

CPU hot-unplug works like this: 
  guest OS is notifies through ACPI that cpu is going to be removed
  guest OS stops to use cpu (makes it offline)
  cpu is ejected (removed from a socket on MB) (kvm never does that part)

So which part do you want to know about from a host?

You can't really know from a host if cpu is used by guest OS (if it is
online/offline in s guest in our terminology)

inserted/ejected is management action (it can't be initiated by a
guest), so you can keep track of it by yourself. KVM doesn't do it
for you right now. More precisely it does, but doesn't have a way to
quire it.

> 
> 2) In my case, the cpus are ALWAYS reported as halted, regardless of the
> current state in the guest. 
This is cosmetic but. It does not affect any operation.

> After the guest booted, The "cpu infos" displays precisely the amount of
> cpus as initially set by the -smp parameter of kvm. (as halted).
> any additional cpus added later will be displayed, also as halted -
> again regardless whether or not the guest switches or had switched them
> to online. It is reported as "halted" even whilst the guest is running a
> cpu-hogger which would stop the cpu from halting.
> I don't mind so much about this cosmetic display problem ;) 
> 
Rightly so since even when it works information it displays is already
outdated at the moment you see it anyway. It is useful for debugging,
thus I keep fixing it when it breaks.

--
			Gleb.

  parent reply	other threads:[~2010-09-19 14:36 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17 21:39 cpu hotplug Conrad Wood
2010-09-18 14:32 ` Kevin O'Connor
2010-09-18 15:14   ` Conrad Wood
2010-09-18 18:27   ` Conrad Wood
2010-09-19  6:38     ` Gleb Natapov
2010-09-19 10:41       ` Conrad Wood
2010-09-19 10:46         ` Gleb Natapov
2010-09-19 11:09           ` Conrad Wood
2010-09-19 11:13             ` Gleb Natapov
2010-09-19 11:32               ` Conrad Wood
2010-09-19 11:39                 ` Gleb Natapov
2010-09-19 11:51                   ` Conrad Wood
2010-09-19 11:59                     ` Gleb Natapov
2010-09-19 12:18                       ` Conrad Wood
2010-09-19 15:20                       ` Avi Kivity
2010-09-19 15:22                         ` Gleb Natapov
2010-09-19 13:26       ` Kevin O'Connor
2010-09-19 13:29         ` Conrad Wood
2010-09-19 13:31           ` Gleb Natapov
2010-09-19 13:35             ` Conrad Wood
2010-09-19 13:40               ` Gleb Natapov
2010-09-19 13:46                 ` Kevin O'Connor
2010-09-19 13:50                   ` Gleb Natapov
2010-09-19 14:07                     ` Conrad Wood
2010-09-19 14:14                       ` Kevin O'Connor
2010-09-19 14:36                       ` Gleb Natapov [this message]
2010-09-19 15:16                         ` Conrad Wood
2010-09-19 15:19                           ` Gleb Natapov
2010-09-19 15:37                             ` Conrad Wood
2010-09-19 15:41                               ` Gleb Natapov
2010-09-19 15:44                                 ` Conrad Wood
2010-09-19 15:53                                   ` Gleb Natapov
2010-09-19 16:04                                     ` Kevin O'Connor
2010-09-19 16:12                                       ` Gleb Natapov
2010-09-19 22:03                                         ` Kevin O'Connor
2010-09-20  6:50                                           ` Gleb Natapov
2010-09-21  1:07                                             ` Kevin O'Connor
2010-09-21  6:42                                               ` Gleb Natapov
2010-09-21  9:38                                               ` Gleb Natapov
2010-09-19 16:24                                       ` Conrad Wood
2010-09-19 21:57                                         ` Kevin O'Connor
2010-09-20  6:48                                           ` Gleb Natapov
2010-09-19 13:38           ` Kevin O'Connor
2010-09-19 13:39             ` Conrad Wood
  -- strict thread matches above, loose matches on Subject: below --
2017-01-01 10:03 CPU HOTPLUG Ozgur O Kilic

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=20100919143611.GW3008@redhat.com \
    --to=gleb@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kvm@conradwood.net \
    /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.