qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, John Snow <jsnow@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH] ahci: Add comment for possible slowness on ahci_irq_lower()
Date: Wed, 20 Nov 2024 11:30:46 -0500	[thread overview]
Message-ID: <20241120163046.3661675-1-peterx@redhat.com> (raw)

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 <jsnow@redhat.com>
Link: https://lore.kernel.org/r/CABgObfbXuiqw01mzVLZEgw-o_tdbf83QzYugq7oL4g7TFVV_yg@mail.gmail.com
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/ide/ahci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 0eb24304ee..7ddcc4e37c 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -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);
 
-- 
2.45.0



                 reply	other threads:[~2024-11-20 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241120163046.3661675-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).