From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: credit2's csched_init() registering of a CPU notifier Date: Fri, 18 Mar 2011 12:25:35 +0000 Message-ID: <4D835D4F02000078000373CA@vpn.id2.novell.com> References: <4D8332E10200007800037367@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4D8332E10200007800037367@vpn.id2.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 18.03.11 at 10:24, "Jan Beulich" wrote: > George, >=20 > as ->init() can be called more than once (for CPU pools) it seems > wrong to do any global initialization in ->init(). The question is > whether it's worth adding a ->global_init(), or whether instead > a callout from the notifier schedule.c sets up wouldn't be a > better mechanism (though that would require maintaining a list > of scheduler instances). Just moving this onto a global_init doesn't work (crashes), and looking at what the notifier handler does I wonder why it's needed at all - csched_alloc_pdata() also calls init_pcpu(), and that ought to be the canonical way. Plus there's also this somewhat frightening comment "Hope this is safe from cpupools switching things around. :-)" in csched_cpu_starting(). Minimally I think there needs to be a check that *ops really is credit2's. Jan