qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RESEND] apic: Don't iterate past last used apic


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH RESEND] apic: Don't iterate past last used apic
Date: Tue, 16 Nov 2010 09:47:11 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

On 11/05/2010 05:01 PM, Alex Williamson wrote:
local_apics are allocated sequentially and never removed, so
we can stop any iterations that go to MAX_APICS as soon as we
hit the first NULL.  Looking at a small guest running a virtio-net
workload with oprofile, this drops apic_get_delivery_bitmask()
from #3 in the profile to down in the noise.

Signed-off-by: Alex Williamson<address@hidden>

Applied.  Thanks.

Regards,

Anthony LIguori

---

  hw/apic.c |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/apic.c b/hw/apic.c
index 63d62c7..5f4a87c 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -437,6 +437,8 @@ static int apic_find_dest(uint8_t dest)
          apic = local_apics[i];
        if (apic&&  apic->id == dest)
              return i;
+        if (!apic)
+            break;
      }

      return -1;
@@ -472,6 +474,8 @@ static void apic_get_delivery_bitmask(uint32_t 
*deliver_bitmask,
                          set_bit(deliver_bitmask, i);
                      }
                  }
+            } else {
+                break;
              }
          }
      }







reply via email to

[Prev in Thread] Current Thread [Next in Thread]