All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Qing He <qing.he@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [RFC] irq rate limit
Date: Wed, 09 Sep 2009 10:29:00 +0100	[thread overview]
Message-ID: <C6CD33EC.14482%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <20090909090700.GB25462@ub-qhe2>

On 09/09/2009 10:07, "Qing He" <qing.he@intel.com> 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

  reply	other threads:[~2009-09-09  9:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09  8:48 [RFC] irq rate limit Qing He
2009-09-09  8:48 ` Keir Fraser
2009-09-09  9:07   ` Qing He
2009-09-09  9:29     ` Keir Fraser [this message]
2009-09-10  9:05       ` Qing He
2009-09-15 13:10       ` [PATCH] irq ratelimit Qing He
2009-09-16  8:17         ` Keir Fraser
2009-09-09 14:12 ` [RFC] irq rate limit Konrad Rzeszutek Wilk
2009-09-10  9:17   ` Qing He

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=C6CD33EC.14482%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=qing.he@intel.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.