From: Ian Campbell Subject: Re: [RFC/RFT][PATCH 1 of 3] Move locking into pluggable schedulers. Date: Wed, 23 Nov 2011 17:30:03 +0000 Message-ID: <1322069403.9567.0.camel@dagon.hellion.org.uk> References: <1322060131.30168.15.camel@Abyss> <1322060876.30168.18.camel@Abyss> <1322065473.1005.151.camel@zakaz.uk.xensource.com> <1322068169.26883.35.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1322068169.26883.35.camel@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dario Faggioli Cc: George Dunlap , Juergen Gross , "xen-devel@lists.xensource.com" , "Keir (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Wed, 2011-11-23 at 17:09 +0000, Dario Faggioli wrote: > On Wed, 2011-11-23 at 16:24 +0000, Ian Campbell wrote: > > > struct csched_private { > > > + /* lock for the whole pluggable scheduler, nests inside cpupool_lock */ > > > spinlock_t lock; > > > struct list_head active_sdom; > > > uint32_t ncpus; > > > > Given that every scheduler plugin is going to need this lock perhaps it > > could be provided globally (but still have the responsibility for using > > it fall on the plugin)? > > > Makes sense to me, and it should be something pretty easy to do, if you > were thinking of just moving the lock to general code. > I'm saying this because both credit and credit2 has much more payload in > their `struct csched_private', and if we also want to get rid of the > struct for them as well, that would be a different story! :-) No, I just meant the lock. > > > I was mainly thinking of the sedf case where you add and maintain the > > whole structure for just that lock. Perhaps you have future plans which > > involve having to do that anyway in which case maybe my suggestion > > doesn't make sense. > > > I know and I agree, that 1-field-struct is just as ugly as hell! Reason > why I went for it are homogeneity with the current code of all the > schedulers, and yes, also, what you're saying above, i.e., it might turn > useful in future to have some scheduler-wide repository in sedf as it is > now for credit*. But no, I don't have _specific_ plans yet, so your > comment do make sense. > > Anyway, even if we'd stay with what's in this patch, I think this at > least need some commenting... > > Thanks and Regards, > Dario >