From: Olaf Hering <olaf@aepfle.de>
To: Patrick Colp <pjcolp@cs.ubc.ca>
Cc: xen-devel@lists.xensource.com
Subject: Re: xenpaging crashes xen in is_iomem_page()
Date: Mon, 9 Aug 2010 19:39:34 +0200 [thread overview]
Message-ID: <20100809173934.GA12523@aepfle.de> (raw)
In-Reply-To: <AANLkTik9HwPPDkex5XYp4EMm5xiNJwB=pN2=7Mwtbhoa@mail.gmail.com>
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:
next prev parent reply other threads:[~2010-08-09 17:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 11:58 xenpaging crashes xen in is_iomem_page() Olaf Hering
2010-07-26 13:15 ` Patrick Colp
2010-07-26 14:08 ` Olaf Hering
2010-07-26 14:39 ` Patrick Colp
2010-07-26 14:58 ` Tim Deegan
2010-07-26 15:23 ` Patrick Colp
2010-07-27 15:20 ` Olaf Hering
2010-07-27 15:46 ` Patrick Colp
2010-07-27 18:25 ` Olaf Hering
2010-07-27 18:39 ` Patrick Colp
2010-07-28 15:26 ` Olaf Hering
2010-07-28 16:22 ` Patrick Colp
2010-08-06 11:16 ` Olaf Hering
2010-08-09 13:30 ` Patrick Colp
2010-08-09 17:39 ` Olaf Hering [this message]
2010-08-09 18:23 ` Patrick Colp
2010-08-10 14:19 ` Olaf Hering
2010-08-10 15:02 ` Patrick Colp
2010-08-10 15:06 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100809173934.GA12523@aepfle.de \
--to=olaf@aepfle.de \
--cc=pjcolp@cs.ubc.ca \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).