On Sun, 2 Oct 2022 15:03:04 +0200
Pim <v...@pronk.nl> wrote:

> Hey,
> 
> After noticing this commit:
> https://github.com/torvalds/linux/commit/7ab5e10eda02da1d9562ffde562c51055d368e9c
> and because of high energy prices here, I did some tests with an energy
> monitor to see what the power consumption is for my AMD RX480when its
> not used. The RX480 is normally only used to pass through to a vm, but
> this vm is mostly switched off so the RX480 is not used.

In order to get the full benefit from the above commit, you'll need to
have a system that supports D3cold, otherwise you'll only see an
incremental improvement of also placing root ports in D3hot in addition
to the device from previous D3host support.  I can't really offer any
advice regarding systems that support this, I assume it's common in
laptops but not so much in desktops.  As the patch series describes, we
can't simply use PCI config space registers to enter D3cold, we need
hardware and firmware support that's generally invoked through ACPI in
order to remove power to the slot.

Certainly do check to make sure that all the devices under the root
port and the root port itself are also in D3hot.  If any devices under
the bridge remain in a running state, then runtime PM cannot enter
D3cold.

> The result is that when I boot my system with vfio-pci enabled it uses
> ~90Watt (RX480 driver = vfio-pci), but when I boot my system with
> vfio-pci disabled (RX480 driver = amdgpu) then my system uses ~80Watt.
> Both times the RX480 is in D3hot power state.
> 
> Any idea why using the vfio-pci driver results in ~10Watt more power
> consumption?

Probably because the native driver can power down more parts of the
device than we can via the generic PCI interface that gets us to D3hot.
vfio-pci does not have code to reach a device specific low power state.
If slot level power control was available, the referenced commit should
entirely power-off the device.  Thanks,

Alex

_______________________________________________
vfio-users mailing list
vfio-users@redhat.com
https://listman.redhat.com/mailman/listinfo/vfio-users

Reply via email to