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] xenpaging: handle evict failures

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenpaging: handle evict failures
From: Tim Deegan <tim@xxxxxxx>
Date: Thu, 13 Oct 2011 12:24:18 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 13 Oct 2011 04:24:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <bdd49540f1e1c803d01c.1318336570@xxxxxxxxxxxx>
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: <bdd49540f1e1c803d01c.1318336570@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
At 14:36 +0200 on 11 Oct (1318343770), Olaf Hering wrote:
> xenpaging: handle evict failures
> 
> Evict of a nominated gfn must fail if some other process mapped the
> page without checking the p2mt of that gfn first.
> Add a check to cancel eviction if the page usage count is not 1.
> 
> Handle the possible eviction failure in the page-in paths.
> After nominate and before evict, something may check the p2mt and call
> populate. Handle this case and let the gfn enter the page-in path. The
> gfn may still be connected to a mfn, so there is no need to allocate a
> new page in prep.
> 
> Adjust do_mmu_update to return -ENOENT only if the gfn has entered the
> page-in path and if it is not yet connected to a mfn. Otherwise
> linux_privcmd_map_foreign_bulk() may loop forever.
> 
> Add MEM_EVENT_FLAG_EVICT_FAIL to inform pager that a page-in request for
> a possible not-evicted page was sent. xenpaging does currently not need
> that flag because failure to evict a gfn will be caught.
> 
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

This doesn't completely close off that race condition (that will require
the p2m refcounting that's being discussed in another thread) but it's a
big improvement so I've applied it.

Cheers,

Tim.

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

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