Re: [PATCH v3 2/2] cpufreq: add virtual-cpufreq driver
From: Viresh Kumar
Date: Thu Aug 03 2023 - 01:52:09 EST
On 02-08-23, 15:16, Saravana Kannan wrote:
> This is mainly an optimization to reduce the latency of the "frequency
> change" which has a huge impact on the performance (as can be seen
> from the numbers in the cover letter).
>
> Setting this flag means that the vCPU thread triggering the MMIO
> handling (on the host side) is the thread on which the host needs to
> apply any uclamp settings. So this avoids the VMM having to look up
> the right vCPU thread that corresponds to this CPU, and any
> permissions issues wrt setting another threads uclamp, etc. This
> becomes even more important if/when BPF support is added for handling
> simple MMIO read/writes. Will Deacon has been working on the eBPF
> part[1] and IIUC, not setting this flag adds a lot of extra overhead
> on the BPF side.
>
> So, yeah, this flag is very helpful wrt reducing latency/simplifying
> host side implementation and that's why we want it here.
>
> [1] - https://kvm-forum.qemu.org/2023/talk/AZKC77/
Would be good to have a (big) comment in the code explaining that as
it isn't obvious. Thanks.
--
viresh