From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: Linux spin lock enhancement on xen Date: Tue, 17 Aug 2010 18:58:21 -0700 Message-ID: <20100817185821.7947c500@mantra.us.oracle.com> References: <20100816183357.08623c4c@mantra.us.oracle.com> <4C6A64F5.E57C.0030.1@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C6A64F5.E57C.0030.1@novell.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: Ky Srinivasan Cc: Jan, "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, 17 Aug 2010 08:34:49 -0600 "Ky Srinivasan" wrote: .. > While I agree that a directed yield is a useful construct, I am not > sure how this protocol would deal with ticket spin locks as you would > want to implement some form of priority inheritance - if the vcpu you > are yielding to is currently blocked on another (ticket) spin lock, > you would want to yield to the owner of that other spin lock. > Clearly, this dependency information is only available in the guest > and that is where we would need to implement this logic. I think > Jan's "enlightened" spin locks implemented this kind of logic. Frankly, I'm opposed to ticket spin locks. IMO, starvation and fairness are schedular problems and not of spin locks. If a vcpu has higher priority, it is for a reason, and I'd like it to get prioritized. Imagine a cluster stack in a 128 vcpu environment, the thread doing heartbeat definitely needs the prirority it deserves. Having said that, my proposal can be enhanced to take into consideration ticket spin locks by having unlock make sure next vcpu in line has temporary priority boost. thanks, Mukesh