From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] sched: fix race between sched_move_domain() and vcpu_wake() Date: Fri, 11 Oct 2013 10:36:31 +0100 Message-ID: <5257C69F.1070609@citrix.com> References: <5257BEBA.2070701@citrix.com> <5257E1CA02000078000FA7D3@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VUZ9B-00068e-5m for xen-devel@lists.xenproject.org; Fri, 11 Oct 2013 09:36:37 +0000 In-Reply-To: <5257E1CA02000078000FA7D3@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Andrew Cooper , Juergen Gross , Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org On 11/10/13 10:32, Jan Beulich wrote: >>>> On 11.10.13 at 11:02, Andrew Cooper wrote: >> On 11/10/2013 09:07, Keir Fraser wrote: >>> It feels to me like this is separate from Andrew's concern. Also I think >>> that holding the schedule_lock should protect you from changes to >>> v->processor. But if that's really unreasonable (e.g., inefficient) then >>> your suggestion here is perfectly sensible. >>> >>> Improving the vcpu_schedule_lock_irq implementations to use the providied >>> underlying spin_lock_irq functions would also be nice, I guess :) >> >> This is an orthogonal issue which could do with fixing. Do note that >> simply making changes to vcpu_schedule_lock() to return the appropriate >> lock is not sufficient to fix this issue, as the race with changing >> v->processor can cause two cpus to "successfully" lock the vcpu schedule >> lock for a particular vcpu. > > Yes indeed. It's just that with such adjustments the fix here > would become more "natural" in no longer having to open-code > the schedule_lock access. > > I suppose you scanned the code for other cases like this, and > there are none? Would it be sensible to get this fix in as-is? It's a minimal fix that I think would be more suitable for backporting to the stable trees rather than a reworking of the vcpu_schedule_lock() and friends? David