public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dean Nelson <dcn@sgi.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>, Alan Mayer <ajm@sgi.com>,
	Dimitri Sivanich <sivanich@sgi.com>,
	jeremy@goop.org, rusty@rustcorp.com.au,
	suresh.b.siddha@intel.com, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yinghai Lu <Yinghai.lu@amd.com>
Subject: Re: [RFC 0/4] dynamically allocate arch specific system vectors
Date: Thu, 18 Sep 2008 08:37:33 -0500	[thread overview]
Message-ID: <20080918133733.GA8830@sgi.com> (raw)
In-Reply-To: <m17i9a61l2.fsf@frodo.ebiederm.org>

On Wed, Sep 17, 2008 at 11:59:05AM -0700, Eric W. Biederman wrote:
> 
> I need to look at these patches some more (apologies I got busy).

Thanks for taking a look.

I've got a not-quite-complete new version of the patchset that addresses
most of the issues raised by Ingo. At it's heart is the following:


 arch/x86/kernel/irq.c___(new)_________________________________

#include <linux/irq.h>

static cpumask_t domain_online;

int grab_irq_vector(struct irq_desc *desc, unsigned int vector,
		   cpumask_t *domain)
{
	/* Must be called with vector lock held */
	int cpu;

	cpus_and(domain_online, *domain, cpu_online_map);

	for_each_cpu_mask_nr(cpu, domain_online) {
		if (per_cpu(vector_irq, cpu)[vector] != NULL)
			return -EBUSY;
	}

	/* Available reserve it */
	for_each_cpu_mask_nr(cpu, domain_online)
		per_cpu(vector_irq, cpu)[vector] = desc;

	return vector;
}


 arch/x86/kernel/io_apic.c_____________________________________

static int ioapic_grab_irq_vector(struct irq_desc *desc, unsigned int vector,
				  cpumask_t *domain)
{
	/* Must be called with vector lock held */
	struct irq_cfg *cfg;
	int ret;

	ret = grab_irq_vector(desc, vector, domain);
	if (ret == vector) {
		cfg = irq_cfg(desc->irq);
		if (cfg->vector) {
			cfg->move_in_progress = 1;
			cfg->old_domain = cfg->domain;
		}
		cfg->vector = vector;
		cfg->domain = *domain;
	}
	return ret;
}

I've also restructured the order of the patchset so that the first
three patches switch vector_irq from an irq # to an irq_desc pointer, 
replace system_vectors[] usage by a call to grab_irq_vector(), and
finally replace used_vectors[] usage by a call to grab_irq_vector().
You may find these three patches meaningful in and of themselves
since Ingo seemed to indicate that they cleaned up some of the code.

The last patch adds the dynamic allocate of system irq, which, if I'm
understanding correctly, needs to be reworked so that SGI's UV irq
needs get satisfied through a variant of MSI. The MSI code isn't
something I've looked at before.


> We can not assign a vector to all CPUS.
> 
> We don't have the fields for vector -> irq mapping for cpus that
> are not-online.  So we can only assign to cpus that are online now.
> And latter add the other cpus when they come online.
> 
> I have had that oops, it sucks, I don't want to go back.

I reworked the above functions so that grab_irq_vector() enforces
online CPUS only. (I'm assuming your statements applies to per_cpu
vector_irq, as well. If not, then grab_irq_vector() could accept a
cpu_possible_map domain if NON_IRQ_DESC is passed as the desc pointer.)

We'll need to ensure that when a CPU comes online that its vector_irqs
that need to be set to NON_IRQ_DESC, get set properly by
__setup_vector_irq().


Thanks,
Dean

  reply	other threads:[~2008-09-18 13:37 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 15:37 [Fwd: [PATCH] x86_64: (NEW) Dynamically allocate arch specific system vectors] Alan Mayer
2008-08-11 16:59 ` [PATCH] x86_64: (NEW) Dynamically allocate arch specific system vectors Ingo Molnar
2008-08-11 17:14   ` Alan Mayer
2008-08-11 19:39     ` Eric W. Biederman
2008-08-11 19:51       ` Ingo Molnar
2008-08-11 19:55         ` Jeremy Fitzhardinge
2008-08-11 20:10         ` Eric W. Biederman
2008-08-11 20:02       ` Alan Mayer
2008-09-11 15:23       ` [RFC 0/4] dynamically " Dean Nelson
2008-09-11 15:25         ` [RFC 1/4] switch vector_irq[] from irq number to irq_desc pointer Dean Nelson
2008-09-11 15:27         ` [RFC 2/4] introduce dynamically allocated system vectors Dean Nelson
2008-09-14 15:39           ` Ingo Molnar
2008-09-14 15:46           ` Ingo Molnar
2008-09-11 15:28         ` [RFC 3/4] switch static system vector allocation to use vector_irq[] Dean Nelson
2008-09-11 15:29         ` [RFC 4/4] switch non-standard SYSCALL_VECTOR " Dean Nelson
2008-09-14 15:40           ` Ingo Molnar
2008-09-14 15:42           ` Ingo Molnar
2008-09-11 20:04         ` [RFC 0/4] dynamically allocate arch specific system vectors H. Peter Anvin
2008-09-12 11:46           ` Dean Nelson
2008-09-14 15:35         ` Ingo Molnar
2008-09-14 15:48           ` Ingo Molnar
2008-09-15 21:50           ` Dean Nelson
2008-09-16  8:24             ` Ingo Molnar
2008-09-16 20:46               ` Dean Nelson
2008-09-17 17:30                 ` Dimitri Sivanich
2008-09-17 18:59                   ` Eric W. Biederman
2008-09-18 13:37                     ` Dean Nelson [this message]
2008-09-18 19:18                       ` H. Peter Anvin
2008-09-17 19:15                 ` H. Peter Anvin
2008-09-17 20:21                   ` Jack Steiner
2008-09-17 22:15                     ` Eric W. Biederman
2008-09-18  1:09                       ` H. Peter Anvin
2008-09-18 19:10                       ` Jack Steiner
2008-09-19  0:28                         ` Eric W. Biederman
2008-09-19  8:48                           ` Ingo Molnar

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=20080918133733.GA8830@sgi.com \
    --to=dcn@sgi.com \
    --cc=Yinghai.lu@amd.com \
    --cc=ajm@sgi.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=sivanich@sgi.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox