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

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

  • To: Sandesh <sandesh.ahiremath@xxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

> > > 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.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.