WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [RFC] irq rate limit

To: Qing He <qing.he@xxxxxxxxx>
Subject: Re: [Xen-devel] [RFC] irq rate limit
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 09 Sep 2009 10:29:00 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 09 Sep 2009 02:29:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090909090700.GB25462@ub-qhe2>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcoxLCDu/hSRJb1sQ2+EasQH2/0vCQAA9VtU
Thread-topic: [Xen-devel] [RFC] irq rate limit
User-agent: Microsoft-Entourage/12.20.0.090605
On 09/09/2009 10:07, "Qing He" <qing.he@xxxxxxxxx> wrote:

>> What's the generation counter for? Why not just zero desc->rl_cnt in the
>> timer handler?
> 
> If zeroing desc->rl_cnt in the timer handler, we have to zero that of
> all irqs. If the numbers of possible irqs is big or sparse, it's a bit
> painful.

Ah yes, I see. An always-on 10ms timer is ugly however. The Intel guys
working on power management won't like it as it will reduce deep-sleep
residency.

I would suggest getting rid of the generation counter and enable the timer
only when the irq_ratelimit_list is non-empty. In do_IRQ(), when rl_cnt
exceeds the threshold:
 now = NOW();
 if ( now < (desc->rl_quantum_start + MILLISECS(10)) )
    Add to irq_ratelimit_list; Kick timer if list was previously empty;
 else
    desc->rl_cnt = 0; desc->rl_quantum_start = now;

And in the timer handler, for each desc on the list:
 desc->rl_cnt = 0; desc->rl_quantum_start = now;

And at the end of the timer handler, do not set_timer().

This approach adds the overhead of get_s_time() every
irq_ratelimit_threshold interrupts, which should be unmeasurably tiny.

 -- Keir



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