WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [Qemu-devel] [PATCH V12 05/17] xen: Add xenfv machine

To: Jan Kiszka <jan.kiszka@xxxxxx>
Subject: [Xen-devel] Re: [Qemu-devel] [PATCH V12 05/17] xen: Add xenfv machine
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Tue, 12 Apr 2011 15:57:50 +0100
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Alexander Graf <agraf@xxxxxxx>, QEMU-devel <qemu-devel@xxxxxxxxxx>
Delivery-date: Tue, 12 Apr 2011 08:00:08 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Wb3GXkfygAw1pjunWoJpHY6x2A0BlHqLHPi7q6CweoE=; b=MIQYytdC3ktjHtTrMzo39ZpK1cLmF9j0r9gFtruppkLmyiBUakoXZvxkCoGg54AAtk 8hNuFWjo19DQMIH43VkkTlkSE4VtKN1sYr49NOiWIEvvMvrxu12VkglotkvQGNIimXJs 04Z/p8W6EPzzY3l4IJ2zKwfdNnOy0RTy1aPmk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=Zan7EAUZ5PPpMju32p+SkMu0+Y3umKujnIjcoHZRN2n2uoCR0lwYVQjYog5jVWsnKt D6r1baNnFH7X/o09fmT4S7JRYAegNKPke/h7mKaz3QXurtCKhv4Tat8OZRnhldoqdH8X fgZYefKyxtk/MSUgmpVsvhDCmz4cw8rgvtnxI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DA35CC8.6030909@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1301423290-12443-1-git-send-email-anthony.perard@xxxxxxxxxx> <1301423290-12443-6-git-send-email-anthony.perard@xxxxxxxxxx> <4D9F1249.6080305@xxxxxxxxxxx> <alpine.DEB.1.10.1104111852190.9096@xxxxxxxxxxxxxxxxxxxxxxx> <4DA35CC8.6030909@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, Apr 11, 2011 at 20:55, Jan Kiszka <jan.kiszka@xxxxxx> wrote:
>
> On 2011-04-11 20:10, Anthony PERARD wrote:
> >>>  }
> >>>
> >>>  static CPUState *pc_new_cpu(const char *cpu_model)
> >>> @@ -952,7 +957,12 @@ void pc_cpus_init(const char *cpu_model)
> >>>  #endif
> >>>      }
> >>>
> >>> -    for(i = 0; i < smp_cpus; i++) {
> >>> +    if (!xen_enabled()) {
> >>> +        for(i = 0; i < smp_cpus; i++) {
> >>> +            pc_new_cpu(cpu_model);
> >>> +        }
> >>> +    } else {
> >>> +        /* Xen require only one Qemu VCPU */
> >>>          pc_new_cpu(cpu_model);
> >>
> >> This looks a bit fishy. What is the semantic of -smp 2 or more in Xen
> >> mode? If that is an invalid/unused configuration option, catch that and
> >> reject it instead of installing this workaround. If it has a valid
> >> semantic, please elaborate why you need to restrict the number of
> >> instantiated cpus. Just to optimize memory usage?
> >
> > I thought in a first place that was needed to avoid errors. But it works
> > also when we initialise other CPUs. But I prefere to keep it that way to
> > save memory and in the case where there is a thread for each cpu that
> > will also avoid to have many useless threads.
>
> How much memory does this save? More than a few KB per VCPU? That should
> be negligible compared to the normal size of VMs. And as long as we do
> not support multi-threaded TCG VCPUs, Xen will only create on thread for
> all VCPUs (once that may change, Xen could control the "execution" model
> via qemu_init_vcpu).
>
> So I would prefer to avoid this additional Xen-specific branch in
> generic code.

For this patch series, I will remove this Xen specific branch.

For information, we want to run qemu in a tiny domain (Xen guest) of
32MB, so each 30KB per VCPU can count and in a Xen environment, the VM
memory is allocated outside of QEMU, by the hypervisor.
So, we will deal with these extra bytes later, and maybe found a
better way to do it :).

Thanks,

--
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel