Port-xen archive

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

Re: Dom0 starvs DomU



On Sun, Nov 15, 2015 at 03:12:23PM +0100, Manuel Bouyer wrote:
> On Sun, Nov 15, 2015 at 03:08:28PM +0100, dieter roelants wrote:
> > On Sun, 15 Nov 2015 14:16:46 +0100
> > tg%gmplib.org@localhost (Torbjörn Granlund) wrote:
> > 
> > > 
> > > Please understand that I have yet to hit a (NetBSD release x Xen release
> > > x configuration) where compiling in Dom0 does not make DomU disk
> > > operations outragously slow.
> > > 
> > > The underlying disk speed does not seem to be a factor.  (I used to have
> > > spinning rust, now most systems run top-of-the-line SSDs.)
> > > 
> > > Instead of asking me to try more configurations, please consider trying
> > > to reproduce this.
> > 
> > A possibly interesting datapoint; I have recently seen (multiple times)
> > similar symptoms but under different circumstances. The culprit in my
> > case was a misbehaving web application of which the backend crashed and
> > the javascript frontend kept on constantly sending requests. This
> > resulted in firefox hogging the CPU in dom0 and also in ssh sessions to
> > the domU's being barely responsive. So, no real I/O involved here
> > (although I guess network access may have been responsible too).
> 
> It would be interesting to know if the CPU time is spent in
> kernel or userland. The dom0's CPU being busy in kernel could indeed explain
> it.

This did give me an idea, and I think I found a bug in the xbd backend.
It looks like the kernel thread is created with the wrong priority.
Could you try the attached patch ?

I could reproduce the problem creating a small loop around a syscall in dom0,
and the attached patch fixes the issue for me.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: xbdback_xenbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/xen/xbdback_xenbus.c,v
retrieving revision 1.60
diff -u -p -u -r1.60 xbdback_xenbus.c
--- xbdback_xenbus.c	21 Sep 2014 12:46:15 -0000	1.60
+++ xbdback_xenbus.c	15 Nov 2015 14:23:53 -0000
@@ -647,7 +647,7 @@ xbdback_connect(struct xbdback_instance 
 	hypervisor_enable_event(xbdi->xbdi_evtchn);
 	hypervisor_notify_via_evtchn(xbdi->xbdi_evtchn);
 
-	if (kthread_create(IPL_NONE, KTHREAD_MPSAFE, NULL,
+	if (kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
 	    xbdback_thread, xbdi, NULL, "%s", xbdi->xbdi_name) == 0)
 		return 0;
 


Home | Main Index | Thread Index | Old Index