From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH] Scheduling groups, credit scheduler support Date: Mon, 17 Dec 2007 16:57:41 +0000 Message-ID: <20071217165741.GT4614@implementation.uk.xensource.com> References: <20071129201959.GC12559@silverwood.ncultra.org> <20071214170128.GM4296@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20071214170128.GM4296@implementation.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Mike D. Day" , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Samuel Thibault, le Fri 14 Dec 2007 17:01:28 +0000, a écrit : > Mike D. Day, le Thu 29 Nov 2007 15:19:59 -0500, a écrit : > > +static inline struct csched_dom *get_master_dom(struct csched_dom *d) > > +{ > > + if ( d->is_member ) > > + { > > + if ( get_domain(d->master->dom) ) > > + return d->master; > > + BUG(); > > + } > > + return NULL; > > +} > > + > > +static inline void rem_member_from_master(struct csched_dom *member, > > + struct csched_dom *master) > > +{ > > + reclaim_active_vcpus(master, member); > > + member->is_member = 0; > > + member->master = NULL; > > + list_del(&member->group_elem); > > + if (list_empty(&master->group)) > > + master->is_master = 0; > > +} > > Mmm, isn't there a race condition between these, if somebody removes a > member in the middle of somebody else calling master_dom() or > get_master_dom()? More precisely, there is one with SGRP_get_master, which doesn't take the global scheduler lock before calling get_master_dom(). Samuel