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] xenpaging crashes xen in is_iomem_page()

To: Patrick Colp <pjcolp@xxxxxxxxx>
Subject: Re: [Xen-devel] xenpaging crashes xen in is_iomem_page()
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 9 Aug 2010 19:39:34 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 09 Aug 2010 10:40:36 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1281375587; l=3215; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=bazJX+3qp5bgWX5TwCnPDZYPV9Q=; b=Xvs1tDSudPDjmmfeb+m9FgiUtju8qgM9soWoTYHEGnNQ4YXmiBOTJVXID852TVBhOnk ZAiI23Nkf0UMfoNITsWl5SAtYMfWkjcPqEnrTqphgcZGiYMdqXflEtrzYEXpxVfh+bLfk 1Uoci/ecQGULRcuWxrcHqdyFiQUeAGlkjlk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTik9HwPPDkex5XYp4EMm5xiNJwB=pN2=7Mwtbhoa@xxxxxxxxxxxxxx>
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: <20100726115837.GA5643@xxxxxxxxx> <AANLkTimCNX9Cnr8cOpvOw=oDgWObNvXYbXP6=9ZxpCDc@xxxxxxxxxxxxxx> <20100727152045.GA20188@xxxxxxxxx> <AANLkTi=Zqwg1F6k3Nq15NnQVSuJRE8xuFsqOeg54ukuP@xxxxxxxxxxxxxx> <20100806111620.GA457@xxxxxxxxx> <AANLkTik9HwPPDkex5XYp4EMm5xiNJwB=pN2=7Mwtbhoa@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Aug 09, Patrick Colp wrote:

> > after playing a bit more with xenpaging, its not working for me.
> >
> > Whats your environment?
> >
> > I have a plain SLES11 SP1 x86_64 installation on a Xeon X5550 box.
> > The client is also a plain SLES11 SP1 x86_64.
> > Once I boot the client and start xenpaging with 256mb, the client gets
> > lots of SIGBUS or SIGSEGV.
> > Xen prints 'Iomem mapping not permitted ffffffffff (domain 1)' in
> > grant_table.c:__gnttab_map_grant_ref()
> 
> Hi Olaf,
> 
> Thanks for the info. This sounds like an issue with PV drivers.
> Unfortunately I haven't been able to properly vet the PV driver stuff
> yet, but I'll try to get on it as soon as I can.

Patrick,

in xenpaging.c:main() there is that loop which evicts pages before it
enters the while(1) loop. Since that loop will take some time before it
proceeds and receives events from xen, what will happen with page-in
requests during the initial evict loop? Are they queued up, or could
they cause all the errors during client bootup?
I tried to move the initial evict_victim() calls into the while(1) loop.
If there is no event from xc_wait_for_event_or_timeout(), fill &victims
one by one.

My attempt looks basically like shown below.
Unfortunately, it crashes xen itself in odd ways. I will look at this
route further tomorrow.

Also, what is the best time to run xenpaging. If its called very early,
right after xm start <domainname>, it will cause a crash in the client
when the kernel is still initializing itself. Should there be some kind
of event from the guest when its ready? Early boot skripts could create
such an event.

Olaf


--- xen-unstable.hg-4.1.21925.orig/tools/xenpaging/xenpaging.c
+++ xen-unstable.hg-4.1.21925/tools/xenpaging/xenpaging.c
@@ -474,6 +476,7 @@ int main(int argc, char *argv[])
 {
     domid_t domain_id;
     int num_pages;
+    int evicted_pages;
     xenpaging_t *paging;
     xenpaging_victim_t *victims;
     mem_event_request_t req;
@@ -496,6 +499,7 @@ int main(int argc, char *argv[])

     domain_id = atoi(argv[1]);
     num_pages = atoi(argv[2]);
+    evicted_pages = 0;

     victims = calloc(num_pages, sizeof(xenpaging_victim_t));

@@ -521,20 +525,24 @@ int main(int argc, char *argv[])

     /* Evict pages */
     memset(victims, 0, sizeof(xenpaging_victim_t) * num_pages);
+#if 0
     for ( i = 0; i < num_pages; i++ )
     {
+        fprintf(stderr, "%s(%u) page %d\n",__func__,__LINE__, i);
         evict_victim(xch, paging, domain_id, &victims[i], fd, i);
         if ( i % 100 == 0 )
             DPRINTF("%d pages evicted\n", i);
     }

     DPRINTF("pages evicted\n");
+#endif

     /* Swap pages in and out */
     while ( 1 )
     {
         /* Wait for Xen to signal that a page needs paged in */
         rc = xc_wait_for_event_or_timeout(xch, paging->mem_event.xce_handle, 
100);
+        fprintf(stderr, "%s(%u) rc %d\n",__func__,__LINE__, rc);
         if ( rc < -1 )
         {
             ERROR("Error getting event");
@@ -621,6 +634,11 @@ int main(int argc, char *argv[])
                 }
             }
         }
+       if (evicted_pages < num_pages) {
+        evict_victim(xch, paging, domain_id, &victims[evicted_pages], fd, 
evicted_pages);
+       evicted_pages++;
+        fprintf(stderr, "%s(%u) evicted_pages %d\n",__func__,__LINE__, 
evicted_pages);
+       }
     }

  out:

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