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

Re: [Xen-devel] Vcpu allocation for a newly created domU

To: Sandesh <sandesh.ahiremath@xxxxxxxxx>
Subject: Re: [Xen-devel] Vcpu allocation for a newly created domU
From: "Grzegorz Miłoś" <gm281@xxxxxxxxx>
Date: Thu, 19 Jun 2008 15:30:48 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 19 Jun 2008 07:31:10 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=RbiuJDOOuU7ECcvJZcRXOi/KST+/gL+f07CyQXApCt4=; b=Jrr1kyXpuMJYfoizhqsf3RVHZoETvP9v78JdIgUMhOu8MoQVgYFd5Vvgy3mWQQzYSa Yq0S2a9VW04RtnmVxjDMfROAzg0uvLnSPv9FvPku/3xEBNF1eeNOVcdeW4XJ5VmJPsbs FpB6IZ/21LUrELlZEGeOaGct76DU5igb3Hqlg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=k3DsDXmlhYKgz9Dy9MjZbHCL6M1zF45CmMOvNQIuHvnEjN5/T+WpyDb9f4t4xELFou tan/FUVnR9gSZdTZEjthKxZP4Ti4omh+lo2ERpEIxRx6WSGMq1oTweH1zVRIartcbaz5 tm93vPUNuYa3PFAxQ1kNeXk2ZXCyG7A9hTCVc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1213811921.4439.99.camel@ec4t16cg-1518809>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1213636037.4215.39.camel@ec4t16cg-1518809> <4cac40570806180413j59d3ca82hcc42d34d62ad1192@xxxxxxxxxxxxxx> <1213790518.4439.72.camel@ec4t16cg-1518809> <4cac40570806180909g3b203d4bifac5fab43f93955c@xxxxxxxxxxxxxx> <1213811921.4439.99.camel@ec4t16cg-1518809>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> > > Or is it that domU will get allocated separate vcpu's, irrespective of
>  > > these above vcpu's??
>  >
>  > Each domain, Dom0 and any DomU, will get separate VCPU(s). These are
>  > dynamically bound/run on physical CPUs.
>
> This last statement has aroused another doubt...so iam deviating a bit
>  from the main subject.
>
>  As far as binding VCPUs to CPUs is concerned, when i looked at the
>  scheduler code, after chosing the next VCPU to be scheduled, during
>  context_switch only the curret_cpu on which the scheuler is running is
>  selected.
>   If we look at xen/arch/x86/domain.c: __context_switch() chooses cpu
>  using smp_processor_id(). Also during switch_kernel_stack() the tss
>  struct is assigned to init_tss indexed by smp_processor_id() which
>  represents the current cpu.
>   I was assuming the 'processor' field of the vcpu defines the binding to
>  a particular CPU. But it seems its not the case. Then whats the use of
>  processor field??

processor field defines on which physical CPU was the vcpu run the
last time. A vcpu can be migrated to a different CPU (look:
vcpu_migrate() in common/schedule.c).
smp_processor_id() and current->processor should match in
__context_switch(). Indeed both smp_processor_id() and current rely on
the same cpu_info structure.

Cheers
Gr(z)egor(z)
>

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