From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] MMIO: Make coalesced mmio use a device per zone Date: Tue, 19 Jul 2011 12:53:02 +0300 Message-ID: <1311069182.9174.1.camel@lappy> References: <1311063011-4430-1-git-send-email-levinsasha928@gmail.com> <4E2544F3.9030203@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Marcelo Tosatti To: Avi Kivity Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:60498 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903Ab1GSJx2 (ORCPT ); Tue, 19 Jul 2011 05:53:28 -0400 Received: by wwe5 with SMTP id 5so4014915wwe.1 for ; Tue, 19 Jul 2011 02:53:27 -0700 (PDT) In-Reply-To: <4E2544F3.9030203@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-07-19 at 11:48 +0300, Avi Kivity wrote: > On 07/19/2011 11:10 AM, Sasha Levin wrote: > > This patch changes coalesced mmio to create one mmio device per > > zone instead of handling all zones in one device. > > > > Doing so enables us to take advantage of existing locking and prevents > > a race condition between coalesced mmio registration/unregistration > > and lookups. > > > > > > > > #include "coalesced_mmio.h" > > > > +static spinlock_t lock; > > +static LIST_HEAD(head); > > Make these per-guest instead of global. The lock may be contended, and > the list shouldn't hold items from different guests (why is it needed, > anyway?) > We only need the list for removal, since we only have the range we want to remove, and we want to find all devices which contain this range. > The coalesced mmio devices will now contend with other io devices for > NR_IOBUS_DEVS, so need to increase that (by KVM_COALESCED_MMIO_ZONE_MAX). > -- Sasha.