This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [rfc][patch] use of IRQ_LEVEL to remove strcmp()s

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [rfc][patch] use of IRQ_LEVEL to remove strcmp()s
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 19 Apr 2006 22:11:51 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 19 Apr 2006 14:15:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <5FB0DCE2-8505-4F54-98E6-52EFD64CD5EF@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5FB0DCE2-8505-4F54-98E6-52EFD64CD5EF@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 19 Apr 2006, at 21:58, Jimi Xenidis wrote:

Ok this is blind, but it builds, so please take it more as a suggestion, There are a sequence of strcmp()s in irq.c to detect if an IO-APIC is level or edge triggered. Perhaps (borrowing form Linux) with the use of IRQ_LEVEL, we can detect this more efficiently?

Given the set of hw_interrupt_types we support right now this generalised logic appears to work, but in fact we really are testing for a specific PIC configuration here. For example, if we added a new hw_interrupt_type that was also level-triggered but which could be masked quickly and cleanly then it would have ACKTYPE_UNMASK not ACKTYPE_EOI. So the generalisation you are suggesting (to check for IRQ_LEVEL) doesn't really work.

The strcmps aren't really a problem -- they're not on a critical path, and we explicitly bug if we do not match on any of them so we should be resilient to addition of new PIC types or renamings of existing PIC types. I think the current code has the additional benefit of 'obviousness'.

Side Note: I believe that "ioapic_ack_new" is the same as IRQ_PER_CPU.

Xen/x86 does not use IRQ_PER_CPU at all. ioapic_ack_new simply determines whether we handle level-triggered IO-APIC interrupts by mask-eoi-process-unmask or by process-eoi. The new method is the latter because it turns out that many IO-APICs do not mask cleanly (they create spurious aliased interrupts).

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>