From owner-svn-src-user@FreeBSD.ORG Thu Feb 5 16:41:13 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F8E106564A; Thu, 5 Feb 2009 16:41:13 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 41F638FC1B; Thu, 5 Feb 2009 16:41:12 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 937852C2C3D; Thu, 5 Feb 2009 10:41:12 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6pgu5F2+bNYK; Thu, 5 Feb 2009 10:41:04 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 7754D2C2C55; Thu, 5 Feb 2009 10:41:04 -0600 (CST) Message-ID: <498B169F.8080005@cs.rice.edu> Date: Thu, 05 Feb 2009 10:41:03 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.19 (X11/20090124) MIME-Version: 1.0 To: Doug Rabson References: <200902051509.n15F9gCj030370@svn.freebsd.org> <75E8FE57-7235-4F4D-813B-41BEFE7907C5@rabson.org> In-Reply-To: <75E8FE57-7235-4F4D-813B-41BEFE7907C5@rabson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Doug Rabson , src-committers@freebsd.org, Robert Watson , svn-src-user@freebsd.org Subject: Re: svn commit: r188153 - user/dfr/xenhvm/6/sys/amd64/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 16:41:14 -0000 Doug Rabson wrote: > > On 5 Feb 2009, at 15:39, Robert Watson wrote: > >> >> On Thu, 5 Feb 2009, Doug Rabson wrote: >> >>> Adaptive mutex spinning turns out to be very slightly slower on Xen, >>> probably >>> due to scheduling conflicts with other guests within the same >>> hypervisor. >> >> Part of the effectiveness of adaptive mutexes is in their being able >> to tell with a single read whether or not the thread owning the lock >> is (likely) in execution. This is complicated with a hypervisor >> because although the FreeBSD kernel has the thread in the run state >> doesn't mean that the hypervisor has FreeBSD in the run state. Is >> there any way we could provide similar hints here? As core density >> goes up, people may over-commit hardware resources less, using Xen >> for assigning subsets of the core pool to particular VMs as opposed >> to time-sharing individual cores, in which case we'd like adaptive >> mutexes to work... > > This is indeed the key problem. At least with Xen, there is no way of > telling that the vcpu which is ostensibly executing the lock owning > thread is actually scheduled onto a physical cpu by the hypervisor. > Its something I will encourage the Xen people to improve on in future. I have seen presentations on this topic by AMDers: http://www.amd64.org/research/virtualization.html However, what they are doing is making Linux spin locks adaptive so that they block using a new hypercall that tries to perform a directed yield of the CPU to the preempted lock holder. However, the new hypercall can only guess at who the preempted lock holder is. So, they are not yet worried about completely avoiding pointless spinning, because they first need to get over hump of non-adaptive spinning. Alan