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

[Xen-devel] CPU and scheduler init in Xen


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
  • Date: Tue, 7 Dec 2010 15:05:21 +0000
  • Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 07 Dec 2010 07:18:45 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; b=cdsgPuUVBvHssI7e8a8elFiQhniAr36VFLtmBf0OjRWnXfe6liDvFvTLQgUEZRj4QR R4V+KuWowgYmAR5JW6y/p52x/jeL38w9rllOWdY+Q3WR6+tHz6y1WG09oWKnyNq91zpp iskDCzeRdQJdsXdSpCrJVi6Ne3y6xmWfgZDr8=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

OK, so next roadblock in my grand plan to have credit2 base its
runqueues on the cpu topology:

The scheduler is initialized before the CPU identification stuff is
done; so at the time the switchable init() stuff is called, *and* at
the time alloc_pdata() is called, the data about the cpu topology is
not ready yet.

As far as I can tell, tracing through the tangled web of init
functions, this is because:
* CPU id stuff needs to be done on the CPU itself (make sense), so it
happens when bringing up CPUs
* Before that, cpu_init() wants to do basic initialization, including
writing the CR3 value from current
* So one of the first things that a CPU does when starting is set
current to idle_vcpu[cpuid]
* So the idle vcpu for that VM needs to be ready before the CPU boots
* So the scheduler info for that VM is initialized on the boot cpu
before the other cpus are brought up.

On the one hand that all makes sense, but on the other hand it seems
really crazy not to have basic info like the CPU topology available to
the scheduler when the data for that CPU is initialized, and have to
either (1) have a third scheduler callback, "cpu actually initialized
now", or (2) resort to hackish tricks to look stuff up later (as the
credit1 scheduler does to set up timers).

I was hoping to be able to rearrange stuff so that when alloc_pdata()
is called, that cpu_to_socket() be ready, but it's not exactly clear
the best way to do that.

Any advice on how to proceed, Keir?

 -George

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


 


Rackspace

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