[vfio-users] Eliminate Mini Stutter in "Witcher 3: The Wild Hunt" on top of KVM/VFIO

Okky Hendriansyah okky.htf at gmail.com
Wed Mar 16 06:34:55 UTC 2016


On Wed, Mar 16, 2016 at 12:33 PM, Alex Williamson <
alex.l.williamson at gmail.com> wrote:

> ...
> You didn't say what the original settings were that you were coming from.
> For preempt, I'd guess you were probably using PREEMPT_NONE.  The config
> option descriptions are actually pretty good here:
>

Sorry I forgot to put my previous preempt config. Yes it was PREEMPT_NONE.
If I recall there were 3 preempt configs, none, voluntary and full preempt.
Probably because of LTS kernels are usually for server the official one has
PREEMPT_NONE. Thanks for pointing the kernel config detail description.

The timer frequency is going to affect the granularity of how often we
> switch between tasks.  Higher frequencies are better for interactivity,
> lower frequencies incur less overhead for longer running tasks.  These sort
> of coincide with the preempt descriptions, a lower timer frequency allows
> tasks to run uninterrupted for a longer time, improving throughput, a
> higher timer frequency allow better interactivity since there are more
> scheduling points, at the cost of some throughput.
>

I see, that makes sense. Both config complements each other. I observed my
CPU usage on the host is running on maximum clock frequency when running
Witcher 3, which I did not see on other games. Probably the game itself is
already CPU intensive thus changing the scheduling to voluntary helps
facilitate other graphic interruption.

If you really want to isolate the VM from the host for scheduling purposes,
> you can find other references in the old archlinux thread to using isolcpus
> and nohz_full.  The isolcpus option removes cpus from the general
> scheduler, so those cpus only run the tasks manually schedule for them and
> nohz_full stops the timer tick on the specified cpus whenever possible.
> The idea is to isolate a set of cpus and use them exclusively for running
> the vcpus, providing maximum throughput to the VM, while leaving some cpus
> for the host to handle interactivity and background tasks.  The trouble
> here is that it's great if you want to permanently divide a system between
> VMs or potentially have the host tasks run as subordinate tasks to the VM,
> but it makes it difficult for the host to have full access to all the
> processor resources when the VM is idle or unused.  cgroups (cpusets) would
> probably provide the capability more dynamically, but I don't know that
> anyone has really documented it for this use case.
>

I have seen some people here use isolcpus and nohz_full to fully isolate
some of their CPU cores dedicated to the VM. But like you said, I do not
really like the idea of unbalanced core utilization on my home desktop. I
prefer having the flexibility of starting other VM or other tasks while
running the main WIndows 10 VM, while using all of my cores in balance.
Hmm, I am going to try looking at cgroups/cpusets like you suggested. Thank
you, Alex.

Best regards,
Okky Hendriansyah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20160316/43aceb99/attachment.htm>


More information about the vfio-users mailing list