public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix percpu interrupt allocation in mmtimer code
@ 2006-03-15 14:39 Dimitri Sivanich
  2006-03-16 11:02 ` Jes Sorensen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dimitri Sivanich @ 2006-03-15 14:39 UTC (permalink / raw)
  To: linux-ia64

The timer interrupt in the mmtimer code needs to be allocated as
a percpu interrupt for acceptable performance on larger systems.

The code needs to be updated to set this up properly, as the
SA_PERCPU_IRQ flag to request_interrupt is not supported.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>

Index: linux/arch/ia64/kernel/irq_ia64.c
=================================--- linux.orig/arch/ia64/kernel/irq_ia64.c	2006-03-14 14:52:39.735003644 -0600
+++ linux/arch/ia64/kernel/irq_ia64.c	2006-03-14 14:53:20.219310264 -0600
@@ -239,6 +239,7 @@ register_percpu_irq (ia64_vector vec, st
 				setup_irq(irq, action);
 		}
 }
+EXPORT_SYMBOL(register_percpu_irq);
 
 void __init
 init_IRQ (void)
Index: linux/drivers/char/mmtimer.c
=================================--- linux.orig/drivers/char/mmtimer.c	2006-03-14 14:52:39.736956577 -0600
+++ linux/drivers/char/mmtimer.c	2006-03-14 15:59:04.662279315 -0600
@@ -59,6 +59,8 @@ static int mmtimer_ioctl(struct inode *i
 			 unsigned int cmd, unsigned long arg);
 static int mmtimer_mmap(struct file *file, struct vm_area_struct *vma);
 
+static irqreturn_t mmtimer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+
 /*
  * Period in femtoseconds (10^-15 s)
  */
@@ -70,6 +72,12 @@ static struct file_operations mmtimer_fo
 	.ioctl =	mmtimer_ioctl,
 };
 
+static struct irqaction mmt_irqaction = {
+	.handler =	mmtimer_interrupt,
+	.flags =	SA_INTERRUPT,
+	.name =		MMTIMER_NAME
+};
+
 /*
  * We only have comparison registers RTC1-4 currently available per
  * node.  RTC0 is used by SAL.
@@ -689,11 +697,7 @@ static int __init mmtimer_init(void)
 	mmtimer_femtoperiod = ((unsigned long)1E15 + sn_rtc_cycles_per_second /
 			       2) / sn_rtc_cycles_per_second;
 
-	if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, SA_PERCPU_IRQ, MMTIMER_NAME, NULL)) {
-		printk(KERN_WARNING "%s: unable to allocate interrupt.",
-			MMTIMER_NAME);
-		return -1;
-	}
+	register_percpu_irq(SGI_MMTIMER_VECTOR, &mmt_irqaction);
 
 	strcpy(mmtimer_miscdev.devfs_name, MMTIMER_NAME);
 	if (misc_register(&mmtimer_miscdev)) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix percpu interrupt allocation in mmtimer code
  2006-03-15 14:39 [PATCH] Fix percpu interrupt allocation in mmtimer code Dimitri Sivanich
@ 2006-03-16 11:02 ` Jes Sorensen
  2006-03-16 15:56 ` Christoph Hellwig
  2006-03-16 16:01 ` Dimitri Sivanich
  2 siblings, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2006-03-16 11:02 UTC (permalink / raw)
  To: linux-ia64

>>>>> "Dimitri" = Dimitri Sivanich <sivanich@sgi.com> writes:

Dimitri> The timer interrupt in the mmtimer code needs to be allocated
Dimitri> as a percpu interrupt for acceptable performance on larger
Dimitri> systems.

Dimitri> The code needs to be updated to set this up properly, as the
Dimitri> SA_PERCPU_IRQ flag to request_interrupt is not supported.

Dimitri> +EXPORT_SYMBOL(register_percpu_irq);

Hi Dimitri,

EXPORT_SYMBOL_GPL() please.

Dimitri> +static irqreturn_t mmtimer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
Dimitri> +

The prototype needs to go into a header file, it shouldn't be declared
in mmtimer.c. Also please make sure it doesn't exceed the 80 column
limit.

Cheers,
Jes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix percpu interrupt allocation in mmtimer code
  2006-03-15 14:39 [PATCH] Fix percpu interrupt allocation in mmtimer code Dimitri Sivanich
  2006-03-16 11:02 ` Jes Sorensen
@ 2006-03-16 15:56 ` Christoph Hellwig
  2006-03-16 16:01 ` Dimitri Sivanich
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2006-03-16 15:56 UTC (permalink / raw)
  To: linux-ia64

On Wed, Mar 15, 2006 at 08:39:06AM -0600, Dimitri Sivanich wrote:
> The timer interrupt in the mmtimer code needs to be allocated as
> a percpu interrupt for acceptable performance on larger systems.
> 
> The code needs to be updated to set this up properly, as the
> SA_PERCPU_IRQ flag to request_interrupt is not supported.

Rather than letting the driver poke into irq code internals I'd suggest
you fux the request_irq code to properly support SA_PERCPU_IRQ.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix percpu interrupt allocation in mmtimer code
  2006-03-15 14:39 [PATCH] Fix percpu interrupt allocation in mmtimer code Dimitri Sivanich
  2006-03-16 11:02 ` Jes Sorensen
  2006-03-16 15:56 ` Christoph Hellwig
@ 2006-03-16 16:01 ` Dimitri Sivanich
  2 siblings, 0 replies; 4+ messages in thread
From: Dimitri Sivanich @ 2006-03-16 16:01 UTC (permalink / raw)
  To: linux-ia64

On Thu, Mar 16, 2006 at 03:56:06PM +0000, Christoph Hellwig wrote:
> Rather than letting the driver poke into irq code internals I'd suggest
> you fux the request_irq code to properly support SA_PERCPU_IRQ.
Good suggestion.  I'll make the appropriate changes.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-16 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-15 14:39 [PATCH] Fix percpu interrupt allocation in mmtimer code Dimitri Sivanich
2006-03-16 11:02 ` Jes Sorensen
2006-03-16 15:56 ` Christoph Hellwig
2006-03-16 16:01 ` Dimitri Sivanich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox