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

[Xen-devel] Re: xenpaing: one way to avoid paging out the page, when the

To: Hongkaixing <hongkaixing@xxxxxxxxxx>
Subject: [Xen-devel] Re: xenpaing: one way to avoid paging out the page, when the corresponding mfn is in use.
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Tue, 1 Nov 2011 18:07:48 +0100
Cc: YangXiaowei <xiaowei.yang@xxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>, "Eric Li\(Zhentao\)" <lizhentao@xxxxxxxxxx>, Yanqiangjun <yanqiangjun@xxxxxxxxxx>, hanweidong <hanweidong@xxxxxxxxxx>
Delivery-date: Tue, 01 Nov 2011 10:08:57 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1320167281; l=1352; s=domk; d=aepfle.de; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version: References:Subject:Cc:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=uYvb7zW9lijytaCILA2WEbfyIPk=; b=Lw1mBeBEOFOnMAe3+XEt0gabo5T8w+KyWVWJDgMxjgv+Jtyu8FHpCyiLCLwzG9eodVi cGjQ1z7JYTOTIUXyMEGbhzdTtYg37eByg5o8lbvcGQtDhI5tJtKfr9sE19dQeICLQpCbh x/L6HRFSM0nCqJG0LMPpNXh5gg9EvRlrhRc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E0AF011477D2AE458DC8801E0E570709014C0556@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <E0AF011477D2AE458DC8801E0E570709014C0556@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21.rev5535 (2011-07-01)
On Tue, Nov 01, Hongkaixing wrote:

>    Recently many advanced memory mechanisms are introduced into Xen.
>    One problem we found is the conflict between p2m query and setting.
>    For example, backend drivers always map domU’s page to its own
>    space, during the mapping procedure, situations as follow may
>    happen, when mfn is obtained by gfn_to_mfn(), this mfn is likely to
>    be paged out.
> 
> first case:
>    grant mapping                      xenpaing
>   mfn = gfn_to_mfn();
>                        <-----------  p2m_paging_nominate()
>          |                                         |
>      Check type ok                     paged out;
>          |
>      try to map
> What we want is: 
> When the page (mfn) is accessed by gfn_to_mfn(), this page should
> never be paged out until the mapping action is end. 

The query+map and query+change opterations on p2m entries should be done
under some lock. I have recently updated the p2m_mem_paging* functions
to do their modifications with the p2m_lock held.

Furthermore the change below checks wether something mapped a page
between nominate and evict:

http://xenbits.xen.org/hg/xen-unstable.hg/rev/eda18b27de6e

While this certainly does not fix all possible races, it slightly
reduces the window.


A more complete approach to add locking around p2m modifcations was
recently started by Andres Lagar-Cavilla:

http://lists.xensource.com/archives/html/xen-devel/2011-10/msg01946.html

Olaf

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

<Prev in Thread] Current Thread [Next in Thread>