From: "Jan Beulich" Subject: Re: Possible Xen grant table locking improvements Date: Tue, 21 Oct 2014 10:32:07 +0100 Message-ID: <54464437020000780004098B@mail.emea.novell.com> References: <544547F3.4000506@citrix.com> <20141020180641.GB16349@u109add4315675089e695.ant.amazon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141020180641.GB16349@u109add4315675089e695.ant.amazon.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel , Matt Wilson Cc: Tim Deegan , Keir Fraser , Matt Wilson , "Xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 20.10.14 at 20:06, wrote: > On Mon, Oct 20, 2014 at 06:35:47PM +0100, David Vrabel wrote: >> ### Possible Problems >> >> 1. The "fast" maptrack entries cause a problem when destroying domains. >> >> A domain being destroyed need tear down all active grant maps it has. >> It currently does this with a O(M) operation -- iterating over all the >> maptrack entries. >> >> With the "fast" maptrack entries being stored in the remote domain's >> active grant entry tables, a walk of all map track entries must iterate >> over /every/ domains' active grant entry tables /and/ the local maptrack >> table). This is O(D * G + M), which is maybe too expensive? >> >> (D = number of domains, G = mean grant table size, M = number of local >> maptrack entries). > > Hmmmm, that doesn't sound ideal. I suppose we would also need to walk > all of the active grant entry tables under a lock, which might make > the overall runtime of this operation unpredictable under various load > conditions. It would seem possible to at least limit the set of domains to look at: We could introduce a bitmap (or rangeset) where we track which other domains a given one mapped grants from. Assuming that other than Dom0 would likely serve only a strict subset of all domains, this might already be a win (and domain destruction is slow anyway). Jan