Re: [PATCH 4/5] KVM: Lazify fpu activation and deactivation

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

 



On Thu, 2010-01-14 at 15:11 +0200, Avi Kivity wrote:
> > Strangely, autotest only caught this on AMD and even it took a while.  
> > Lucas, can you integrate something like the following into autotest, 
> > so we exercise the preemption code harder?

All right Avi, just added it to our TODO list, thanks!

> > #!/usr/bin/python
> >
> > import sys, os, re, random, ctypes, time
> >
> > tasks = sys.argv[1:]
> >
> > threads = [int(t)
> >            for k in tasks
> >            for t in os.listdir('/proc/%s/task' % (k,))]
> >
> > cpus = [int(c[3:])
> >         for c in os.listdir('/sys/devices/system/cpu')
> >         if re.match(r'cpu[0-9]+', c)]
> >
> > rand = random.Random()
> >
> > sched_setaffinity = ctypes.CDLL('libc.so.6').sched_setaffinity
> >
> > while True:
> >     pid = rand.choice(threads)
> >     cpu = rand.choice(cpus)
> >     mask = 1 << cpu
> >     sched_setaffinity(ctypes.c_int(pid), ctypes.c_size_t(4), 
> > ctypes.byref(ctypes.c_int(mask)))
> >     try:
> >         time.sleep(0.01)
> >     except:
> >         break
> >

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux