ahci: Add comment for possible slowness on ahci_irq_lower()
PATCH 1/1 ahci: Add comment for possible slowness on ahci_irq_lower()
In some adhoc profiling, it's observed that ahci_irq_lower() can be a hot path and the type cast might be slow and prone to optimizations.
Considering it's in ODD FIXES stage, we may not expect major time consumed yet on this on either developing efforts, or reviewing efforts from maintainers. However still add a comment as suggested by Paolo so we keep it a record for future reference.
Cc John Snow <[email protected]>
Link https://lore.kernel.org/r/CABgObfbXuiqw01mzVLZEgw-o_tdbf83QzYugq7oL4g7TFVV_yg@mail.gmail.com open here
Suggested-by Paolo Bonzini <[email protected]>
Signed-off-by Peter Xu <[email protected]>
--- hw/ide/ahci.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/ide/ahci.c +5 -0
@@ -197,6 +197,11 @@ static void ahci_irq_raise(AHCIState *s)static void ahci_irq_lower (AHCIState *s) {DeviceState *dev_state = s->container; +/* +* NOTE: from some profiling on Linux VM boots, this can trigger quite +* frequently (10000+ when seeing the root prompt). It might be good to +* consider speeding this path up on the type cast. +*/ PCIDevice *pci_dev = (PCIDevice *)object_dynamic_cast (OBJECT (dev_state),TYPE_PCI_DEVICE );
Signature · 1 line
2.45.0