[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Vcpu allocation for a newly created domU
> > > 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |