qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v0 PATCH] cpus: Convert cpu_index into a bitmap


From: David Gibson
Subject: Re: [Qemu-devel] [RFC v0 PATCH] cpus: Convert cpu_index into a bitmap
Date: Thu, 19 Mar 2015 15:43:23 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Mar 18, 2015 at 12:04:04PM +0530, Bharata B Rao wrote:
> On Wed, Mar 18, 2015 at 11:49:59AM +1100, David Gibson wrote:
> > On Fri, Mar 13, 2015 at 05:26:36PM +0530, Bharata B Rao wrote:
> > > From: Bharata B Rao <address@hidden>
> > > 
> > > Currently CPUState.cpu_index is monotonically increasing and a newly
> > > created CPU always gets the next higher index. The next available
> > > index is calculated by counting the existing number of CPUs. This is
> > > fine as long as we only add CPUs, but there are architectures which
> > > are starting to support CPU removal too. For an architecture like PowerPC
> > > which derives its CPU identifier (device tree ID) from cpu_index, the
> > > existing logic of generating cpu_index values causes problems.
> > > 
> > > With the currently proposed method of handling vCPU removal by parking
> > > the vCPU fd in QEMU
> > > (Ref: http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg02604.html),
> > > generating cpu_index this way will not work for PowerPC.
> > > 
> > > This patch changes the way cpu_index is handed out by maintaining
> > > a bit map of the CPUs that tracks both addition and removal of CPUs.
> > > 
> > > I am not sure if this is the right and an acceptable approach. The
> > > alternative is to do something similar for PowerPC alone and not
> > > depend on cpu_index.
> > > 
> > > I have tested this with out-of-the-tree patches for CPU hot plug and
> > > removal on x86 and sPAPR PowerPC.
> > 
> > How does this interact with the tweaking of cpu indexes that spapr
> > does in order to configure the guest SMT mode on POWER7 and POWER8
> > systems?
> 
> I am not changing the mapping of cpu_index to cpu_dt_id. So nothing
> should be change. Can you please point me to the piece of tweaking code
> that you are referring to above ?

Ah, I thought it actually adjusted the cpu_index values, rather than
mapping them to different cpu_dt_id values.  Maybe it used to, or
maybe I just misremembered.

Never mind, should be fine.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpLdy4IjYBg9.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]