[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 5 of 9] x86/mm: Add per-page locking for memory sharing, when audits are disabled


  • To: "Jan Beulich" <JBeulich@xxxxxxxx>
  • From: "Andres Lagar-Cavilla" <andres@xxxxxxxxxxxxxxxx>
  • Date: Mon, 12 Dec 2011 20:29:05 -0800
  • Cc: andres@xxxxxxxxxxxxxx, keir.xen@xxxxxxxxx, Tim Deegan <tim@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, adin@xxxxxxxxxxxxxx
  • Delivery-date: Tue, 13 Dec 2011 04:30:31 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=message-id :in-reply-to:references:date:subject:from:to:cc:reply-to :mime-version:content-type:content-transfer-encoding; q=dns; s= lagarcavilla.org; b=Y7IR1PmQDEIpuiFU4/kdbuYWfrKlib5pmjiNsaxEhnNh bLqwYDHHiKnrPfpJRO7yhUK9ECh7t+I0uCDrXk7u919+LNNM2Bnqb3uxAA8slfs+ MpKBkcmupVbrDrBqDWH1l2U2mbuGMeNfuYFBumcFcLJJ9gdMKHtJ0KDZWXAWozk=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

>  >>> On 09.12.11 at 21:22, Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
> wrote:
>> With the removal of the hash table, all that is needed now is locking
>> of individual shared pages, as new (gfn,domain) pairs are removed or
>> added from the list of mappings.
>>
>> We recycle PGT_locked and use it to lock individual pages. We ensure
>> deadlock
>> is averted by locking pages in increasing order. We leverage an
>> "external"
>> order enforcing construct from mm-locks.h to ensure the p2m_lock (needed
>> to
>> modify gfn entries during sharing) is always taken after page_locks.
>
> As said before, I view taking a coarse lock inside a fine grained one as
> inappropriate, and hence recommend to not apply this patch without
> knowing if/when the promised follow-up patch will make it in.

Glad you brought that up.

The get_gfn*/put_gfn API change was brought forward as a prelude to
fully-synchronized p2m access: both lookups and modifications take a lock.
That code is not in the tree yet, because I'm fighting a few issues with
lock ordering inversions in the sharing code.

But once that code makes it in, get_gfn/put_gfn pairs delimit critical
sections protected by the p2m lock. And the sharing page_lock()s will be
nested inside those sections. In other words, p2m lock first, page lock
second, no lock inside page lock regions.

That will also require inverting the order in which locks are declared at
mm-locks.h. I hope to break through in the p2m locking during January.
Certainly before 4.2-rc1.

Thanks
Andres

>
> Jan
>
>> The global lock remains for the benefit of the auditing code, and is
>> thus enabled only as a compile-time option.
>>
>> Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
>
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.