All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@fujitsu-siemens.com>
To: xen-devel@lists.xensource.com
Subject: Patch: implementing least priority interrupt routing
Date: Tue, 18 Nov 2008 10:59:30 +0100	[thread overview]
Message-ID: <49229202.3030505@fujitsu-siemens.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

Hi,

the attached patch implements interrupt routing to least priority processor
for HVM domains.
Instead of round robin the vcpu with the lowest processor priority is selected
for the interrupt. If multiple vcpus share the same low priority interrupts
are distributed between those round robin.
Tested with BS2000 domain (3 vcpus, idle processors are now preferred
interrupt target).

Juergen

-- 
Juergen Gross                             Principal Developer
IP SW OS6                      Telephone: +49 (0) 89 636 47950
Fujitsu Siemens Computers         e-mail: juergen.gross@fujitsu-siemens.com
Otto-Hahn-Ring 6                Internet: www.fujitsu-siemens.com
D-81739 Muenchen         Company details: www.fujitsu-siemens.com/imprint.html

[-- Attachment #2: lpp_int.patch --]
[-- Type: text/x-patch, Size: 2114 bytes --]

Implementing interrupt routing to least priority processor.
Instead of round robin the vcpu with the lowest processor
priority is selected for the interrupt. If multiple vcpus
share the same low priority interrupts are distributed between
those round robin.

Signed-off-by: juergen.gross@fujitsu-siemens.com

# HG changeset patch
# User juergen.gross@fujitsu-siemens.com
# Date 1227001650 -3600
# Node ID 370b052ca213bb03f234c102d72d774df6a5aa19
# Parent  7640fba355fac233773d183077d7d01c8fd591f3
implementing least priority interrupt routing

diff -r 7640fba355fa -r 370b052ca213 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Tue Oct 28 09:47:35 2008 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Nov 18 10:47:30 2008 +0100
@@ -380,25 +380,35 @@
 struct vlapic *apic_round_robin(
     struct domain *d, uint8_t vector, uint32_t bitmap)
 {
-    int next, old;
-    struct vlapic *target = NULL;
+    int old;
+    uint32_t ppr, ppr_min;
+    struct vlapic *target;
+    struct vlapic *target_min = NULL;
+    struct vcpu *v;
 
-    old = next = d->arch.hvm_domain.irq.round_robin_prev_vcpu;
+    old = d->arch.hvm_domain.irq.round_robin_prev_vcpu;
+    ppr_min = 256;
+    v = d->vcpu[old];
 
     do {
-        if ( ++next == MAX_VIRT_CPUS ) 
-            next = 0;
-        if ( (d->vcpu[next] == NULL) || !test_bit(next, &bitmap) )
+        v = v->next_in_list;
+	if ( v == NULL )
+	    v = d->vcpu[0];
+        if ( !test_bit(v->vcpu_id, &bitmap) )
             continue;
-        target = vcpu_vlapic(d->vcpu[next]);
-        if ( vlapic_enabled(target) )
-            break;
-        target = NULL;
-    } while ( next != old );
+        target = vcpu_vlapic(v);
+        if ( !vlapic_enabled(target) )
+            continue;
+        ppr = vlapic_get_ppr(target);
+	if ( ppr < ppr_min )
+	{
+	    target_min = target;
+	    ppr_min = ppr;
+	    d->arch.hvm_domain.irq.round_robin_prev_vcpu = v->vcpu_id;
+	}
+    } while ( v->vcpu_id != old );
 
-    d->arch.hvm_domain.irq.round_robin_prev_vcpu = next;
-
-    return target;
+    return target_min;
 }
 
 void vlapic_EOI_set(struct vlapic *vlapic)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2008-11-18  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  9:59 Juergen Gross [this message]
2008-11-18 10:10 ` Patch: implementing least priority interrupt routing Keir Fraser
2008-11-18 10:18   ` Keir Fraser
2008-11-18 10:37     ` Juergen Gross

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=49229202.3030505@fujitsu-siemens.com \
    --to=juergen.gross@fujitsu-siemens.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.