All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <jbeulich@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Xen spinlock questions
Date: Mon, 04 Aug 2008 12:36:16 -0700	[thread overview]
Message-ID: <48975A30.2080408@goop.org> (raw)
In-Reply-To: <4896F39A.76E4.0078.0@novell.com>

Jan Beulich wrote:
> Jeremy,
>
> considering to utilize your pv-ops spinlock implementation for our kernels,
> I'd appreciate your opinion on the following thoughts:
>
> 1) While the goal of the per-CPU kicker irq appears to be to avoid all CPUs
> waiting for a particular lock to get kicked simultaneously, I think this
> doesn't have the desired effect. This is because Xen doesn't track what
> event channel you poll for (through SCHEDOP_poll), and rather kicks all CPUs
> polling for any event channel.
>   

There's no problem with kicking all cpus waiting for a given lock, but 
it was intended to avoid kicking cpus waiting for some other lock.  I 
hadn't looked at the poll implementation that closely.  I guess using 
the per-cpu interrupt gives Xen some room to live up to the expectations 
we have for it ;)

> 2) While on native not re-enabling interrupts in __raw_spin_lock_flags()
> may be tolerable (but perhaps questionable), not doing so at least on
> the slow path here seems suspicious.
>   

I wasn't sure about that.  Is it OK to enable interrupts in the middle 
of a spinlock?  Can it be done unconditionally?

> 3) Introducing yet another per-CPU IRQ for this purpose further
> tightens scalability. Using a single, IRQF_PER_CPU IRQ should be
> sufficient here, as long as it gets properly multiplexed onto individual
> event channels (of which we have far more than IRQs). I have a patch
> queued for the traditional tree that does just that conversion for the
> reschedule and call-function IPIs, which I had long planned to get
> submitted (but so far wasn't able to due to lack of testing done on the
> migration aspects of it), and once successful was planning on trying to
> do something similar for the timer IRQ.

There's two lines of work I'm hoping to push to mitigate this:

One is the unification of 32 and 64-bit interrupt handling, so that they 
both have an underlying notion of a vector, which is what we map event 
channels to.  Since vectors can be mapped to a (irq,cpu) tuple, it would 
allow multiple per-cpu vectors/event channels to be mapped to a single 
irq, and do so generically for all event channel types.  That would mean 
we'd end up allocating one set of interrupts for time, function calls, 
spinlocks, etc, rather than percpu.

The other is eliminating NR_IRQ, and making irq allocation completely 
dynamic.

>  I am attaching that (2.6.26 based) patch just for reference.

 From a quick look, you're thinking along similar lines.

    J

  parent reply	other threads:[~2008-08-04 19:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 10:18 Xen spinlock questions Jan Beulich
2008-08-04 10:24 ` Keir Fraser
2008-08-11 12:22   ` Jan Beulich
2008-08-11 12:25     ` Keir Fraser
2008-08-11 14:41     ` Keir Fraser
2008-08-11 18:11       ` Jeremy Fitzhardinge
2008-08-11 18:31         ` Keir Fraser
2008-08-11 18:49           ` Jeremy Fitzhardinge
2008-08-12  9:00             ` Keir Fraser
2008-08-12 16:33               ` Jeremy Fitzhardinge
2008-08-12 17:00                 ` Keir Fraser
2008-08-15 12:15                   ` Jan Beulich
2008-08-15 13:01                     ` Keir Fraser
2008-08-15 14:06                       ` Jan Beulich
2008-08-18 10:01                         ` Keir Fraser
2008-08-15 17:12                       ` Jeremy Fitzhardinge
2008-08-11 18:10     ` Jeremy Fitzhardinge
2008-08-13  7:17       ` Jan Beulich
2008-08-04 19:36 ` Jeremy Fitzhardinge [this message]
2008-08-05  6:32   ` Jan Beulich
2008-08-05  7:33     ` Keir Fraser
2008-08-05 18:09     ` Jeremy Fitzhardinge
2008-08-06  7:15       ` Jan Beulich
2008-08-06  8:47         ` Jeremy Fitzhardinge
2008-08-06  9:35           ` Jan Beulich
2008-08-06 17:53             ` Jeremy Fitzhardinge
2008-08-06 20:21             ` Jeremy Fitzhardinge
2008-08-07  7:21               ` Jan Beulich
2008-08-07 15:47                 ` 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=48975A30.2080408@goop.org \
    --to=jeremy@goop.org \
    --cc=jbeulich@novell.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.