WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 8 of 9] Modify all internal p2m functions to use

To: "Tim Deegan" <tim@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH 8 of 9] Modify all internal p2m functions to use the new fine-grained locking
From: "Andres Lagar-Cavilla" <andres@xxxxxxxxxxxxxxxx>
Date: Thu, 3 Nov 2011 08:16:31 -0700
Cc: andres@xxxxxxxxxxxxxxxx, olaf@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, andres@xxxxxxxxxxxxxx, keir.xen@xxxxxxxxx, Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>, adin@xxxxxxxxxxxxxx
Delivery-date: Thu, 03 Nov 2011 08:29:39 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=lagarcavilla.org; h= message-id:in-reply-to:references:date:subject:from:to:cc :reply-to:mime-version:content-type:content-transfer-encoding; s=lagarcavilla.org; bh=fTXSCA1GrpA6Ep9X4brlkK9b2UY=; b=lZK9EjZ5 MmzedblodzV/r4Rr+Hf+nIPI4kV8sbltBfQSBOqt8vK5qPCs/n5kWzmP1UYHUqA6 KGN36Okza0/Ok13seh581m7FVFe6kQg9nh/ExxdKgMGm5+nbeF+CUabRYIYqLDlC 8AITbKqqOzYgIIt6OpGHocw+SFtTz8BjSco=
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=hrmDUvTMBZyR4QrYnOvxO03aViUPf69PjVdco0gsb7/n Mu4ZPxU2H/dcqjXZH9pIJWTVGgfVYulbv/eVz1rAT8zTsBjAPuDnyRX9CezsNS43 SD+/Fn2qN1hLWLVyLqaJPa8GE0EfujLJlXaKoa71WEvvJRPUfHze3Oi9VAU6Fmo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20111103143321.GE66800@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1319690025@xxxxxxxxxxxxxxxxxxx> <471d4f2754d6516d5926.1319690033@xxxxxxxxxxxxxxxxxxx> <20111027145711.GN59656@xxxxxxxxxxxxxxxxxxxxx> <6aba1d62ce4c04d03baacb87c5453273.squirrel@xxxxxxxxxxxxxxxxxxxxxxxx> <20111103143321.GE66800@xxxxxxxxxxxxxxxxxxxxx>
Reply-to: andres@xxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: SquirrelMail/1.4.21
Hey,
> Hi,
>
> At 07:24 -0700 on 02 Nov (1320218674), andres@xxxxxxxxxxxxxxxx wrote:
>> >> +/* No matter what value you get out of a query, the p2m has been
>> locked
>> >> for
>> >> + * that range. No matter what you do, you need to drop those locks.
>> >> + * You need to pass back the mfn obtained when locking, not the new
>> >> one,
>> >> + * as the refcount of the original mfn was bumped. */
>> >
>> > Surely the caller doesn't need to remember the old MFN for this?
>> After
>> > allm, the whole point of the lock was that nobody else could change
>> the
>> > p2m entry under our feet!
>> >
>> > In any case, I thing there needs to be a big block comment a bit
>> futher
>> > up that describes what all this locking and refcounting does, and why.
>>
>> Comment will be added. I was being doubly-paranoid. I can undo the
>> get_page/put_page of the old mfn. I'm not a 100% behind it.
>
> I meant to suggest that the p2m code should me able to do the
> get_page/put_page without the caller remembering the mfn, since by
> definition it should be able to look it up in the unlock, knowing no-one
> else can have changed it.

Not necessarily. How about sharing? Or paging out? Tricky, tricky. I guess
the easy fix is to tell drop_p2m to not put_page in those cases.

Andres

>
>> I don't think these names are the most terrible -- we've all seen far
>> worse :) I mean, the naming encodes the arguments, and I don't see an
>> intrinsic advantage to
>> gfn_to_mfn(d, g, t, p2m_guest, p2m_unlocked)
>> over
>> gfn_to_mfn_guest_unlocked(d,g,t)
>
> Yep, it's definitely not the worst. :)  It's really just a question of
> verbosity in the headers.
>
> Tim.
>



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