All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Should irq_chip->mask disable percpu interrupts to all cpus, or just to this cpu?
Date: Tue, 23 Sep 2008 13:02:44 -0700	[thread overview]
Message-ID: <48D94B64.3070004@goop.org> (raw)

Hi,

I'm reworking Xen's interrupt handling to isolate it a bit from the
workings of the apic-based code, as Eric suggested a while back.

As I've mentioned before, Xen represents interrupts as event channels. 
There are two major classes of event channels: per-cpu and, erm, not
percpu.  Per-cpu event channels are for things like timers and IPI
function calls which are inherently per-cpu; it's meaningless to
consider, for example, migrating them from cpu to cpu.  I guess they're
analogous to the the local apic vectors.

(Non-percpu event channels can be bound to a particular cpu, and rebound
at will; I'm not worried about them here.)

Previously I allocated an irq per percpu event channel per cpu.  This
was pretty wasteful, since I need about 5-6 of them per cpu, so the
number of interrupts increases quite quickly as cpus does.  There's no
deep problem with that, but it gets fairly ugly in /proc/interrupts, and
there's some tricky corners to manage in suspend/resume.

This time around I'm allocating a single irq for each percpu interrupt
source (so one for timers, one for IPI, etc), and mapping each per-cpu
event channel to each.  But I'm wondering what the correct behaviour of
irq_chip->mask/unmask should be in this case.  Each event channel is
individually maskable, so when ->mask gets called, I can either mask all
the event channels associated with that irq, or just the one for this
cpu.  The latter makes most sense for me, but I don't quite understand
the irq infrastructure enough to know if it will have bad effects globally.

When I request the irq, I pass IRQF_PERCPU in the flags, but aside from
preventing migration, this only seems to have an effect on __do_IRQ(),
which looks like a legacy path anyway.   It seems to me that by setting
it that I'm giving the interrupt subsystem fair warning that ->mask() is
only going to disable the interrupt on this cpu.

Are there any other ill-effects of sharing an irq across all cpus like
this?  I guess there's some risk of contention on the irq_desc lock.

Thanks,
    J

             reply	other threads:[~2008-09-23 20:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23 20:02 Jeremy Fitzhardinge [this message]
2008-09-24  8:45 ` Should irq_chip->mask disable percpu interrupts to all cpus, or just to this cpu? Ingo Molnar
2008-09-24  9:54   ` Eric W. Biederman
2008-09-24 10:18     ` Ingo Molnar
2008-09-24 18:33     ` Jeremy Fitzhardinge
2008-09-24 19:34       ` Eric W. Biederman
2008-09-27 19:44         ` Ingo Molnar
2008-09-28  4:58           ` Jeremy Fitzhardinge

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=48D94B64.3070004@goop.org \
    --to=jeremy@goop.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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.