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

Re: [Xen-devel] xenpaging crashes xen in is_iomem_page()



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


 


Rackspace

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