linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][RFC] fixing the irqwcpustat mess
@ 2003-05-05 19:25 Christoph Hellwig
  2003-05-05 21:37 ` David Mosberger
  2003-05-07  4:24 ` Andi Kleen
  0 siblings, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2003-05-05 19:25 UTC (permalink / raw)
  To: davidm, ak; +Cc: linux-kernel

currently only x86_64 and ia64 don't use the generic irq_cpustat code
and both have to workaround it's brokenness for the non-default case.

x86_64 defines an empty irq_cpustat_t even if it doesn't need one and
ia64 adds CONFIG_IA64 ifdefs around all users.  What about this patch
instead to make __ARCH_IRQ_STAT useable?


--- 1.11/include/asm-ia64/hardirq.h	Wed Feb  5 06:03:22 2003
+++ edited/include/asm-ia64/hardirq.h	Tue Apr 22 22:03:09 2003
@@ -16,6 +16,9 @@
 /*
  * No irq_cpustat_t for IA-64.  The data is held in the per-CPU data structure.
  */
+
+#define __ARCH_IRQ_STAT	1
+
 #define softirq_pending(cpu)		(cpu_data(cpu)->softirq_pending)
 #define syscall_count(cpu)		/* unused on IA-64 */
 #define ksoftirqd_task(cpu)		(cpu_data(cpu)->ksoftirqd)
--- 1.3/include/asm-x86_64/hardirq.h	Tue Nov 12 18:13:39 2002
+++ edited/include/asm-x86_64/hardirq.h	Tue Apr 22 22:03:10 2003
@@ -12,10 +12,6 @@
    special access macros. This would generate better code. */ 
 #define __IRQ_STAT(cpu,member) (read_pda(me)->member)
 
-typedef struct {
-	/* Empty. All the fields have moved to the PDA. */
-} irq_cpustat_t; 
-
 #include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
 
 /*
--- 1.7/include/linux/irq_cpustat.h	Mon Mar 31 18:21:49 2003
+++ edited/include/linux/irq_cpustat.h	Tue Apr 22 22:03:10 2003
@@ -17,9 +17,8 @@
  * definitions instead of differing sets for each arch.
  */
 
-extern irq_cpustat_t irq_stat[];			/* defined in asm/hardirq.h */
-
-#ifndef __ARCH_IRQ_STAT /* Some architectures can do this more efficiently */ 
+#ifndef __ARCH_IRQ_STAT
+extern irq_cpustat_t irq_stat[];		/* defined in asm/hardirq.h */
 #ifdef CONFIG_SMP
 #define __IRQ_STAT(cpu, member)	(irq_stat[cpu].member)
 #else
@@ -31,8 +30,11 @@
 #define softirq_pending(cpu)	__IRQ_STAT((cpu), __softirq_pending)
 #define local_softirq_pending()	softirq_pending(smp_processor_id())
 #define syscall_count(cpu)	__IRQ_STAT((cpu), __syscall_count)
+#define local_syscall_count()	syscall_count(smp_processor_id())
 #define ksoftirqd_task(cpu)	__IRQ_STAT((cpu), __ksoftirqd_task)
+#define local_ksoftirqd_task()	ksoftirqd_task(smp_processor_id())
+
   /* arch dependent irq_stat fields */
-#define nmi_count(cpu)		__IRQ_STAT((cpu), __nmi_count)		/* i386, ia64 */
+#define nmi_count(cpu)		__IRQ_STAT((cpu), __nmi_count)	/* i386 */
 
 #endif	/* __irq_cpustat_h */
--- 1.189/kernel/ksyms.c	Sat Apr 12 18:37:08 2003
+++ edited/kernel/ksyms.c	Tue Apr 22 22:03:10 2003
@@ -400,7 +400,6 @@
 EXPORT_SYMBOL(del_timer);
 EXPORT_SYMBOL(request_irq);
 EXPORT_SYMBOL(free_irq);
-EXPORT_SYMBOL(irq_stat);
 
 /* waitqueue handling */
 EXPORT_SYMBOL(add_wait_queue);
--- 1.39/kernel/softirq.c	Wed Apr 16 09:51:47 2003
+++ edited/kernel/softirq.c	Tue Apr 22 22:03:10 2003
@@ -33,7 +33,10 @@
    - Tasklets: serialized wrt itself.
  */
 
+#ifndef __ARCH_IRQ_STAT
 irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned;
+EXPORT_SYMBOL(irq_stat);
+#endif
 
 static struct softirq_action softirq_vec[32] __cacheline_aligned_in_smp;
 
@@ -321,7 +324,7 @@
 	__set_current_state(TASK_INTERRUPTIBLE);
 	mb();
 
-	ksoftirqd_task(cpu) = current;
+	local_ksoftirqd_task() = current;
 
 	for (;;) {
 		if (!local_softirq_pending())

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

* Re: [PATCH][RFC] fixing the irqwcpustat mess
  2003-05-05 19:25 [PATCH][RFC] fixing the irqwcpustat mess Christoph Hellwig
@ 2003-05-05 21:37 ` David Mosberger
  2003-05-07  4:24 ` Andi Kleen
  1 sibling, 0 replies; 6+ messages in thread
From: David Mosberger @ 2003-05-05 21:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: davidm, ak, linux-kernel

>>>>> On Mon, 5 May 2003 21:25:46 +0200, Christoph Hellwig <hch@lst.de> said:

  Christoph> What about this patch instead to make __ARCH_IRQ_STAT
  Christoph> useable?

Looks great to me.

Thanks,

	--david

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

* Re: [PATCH][RFC] fixing the irqwcpustat mess
  2003-05-05 19:25 [PATCH][RFC] fixing the irqwcpustat mess Christoph Hellwig
  2003-05-05 21:37 ` David Mosberger
@ 2003-05-07  4:24 ` Andi Kleen
  2003-05-07  4:30   ` David Mosberger-Tang
  2003-05-07  5:24   ` Christoph Hellwig
  1 sibling, 2 replies; 6+ messages in thread
From: Andi Kleen @ 2003-05-07  4:24 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: davidm, linux-kernel

On Mon, 2003-05-05 at 21:25, Christoph Hellwig wrote:

>  
> +#ifndef __ARCH_IRQ_STAT
>  irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned;
> +EXPORT_SYMBOL(irq_stat);
> +#endif

Shouldn't this be per_cpu_data ?

-Andi


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

* Re: [PATCH][RFC] fixing the irqwcpustat mess
  2003-05-07  4:24 ` Andi Kleen
@ 2003-05-07  4:30   ` David Mosberger-Tang
  2003-05-07  4:49     ` Andi Kleen
  2003-05-07  5:24   ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: David Mosberger-Tang @ 2003-05-07  4:30 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Christoph Hellwig, davidm, linux-kernel

>>>>> On 07 May 2003 06:24:54 +0200, Andi Kleen <ak@suse.de> said:

  Andi> On Mon, 2003-05-05 at 21:25, Christoph Hellwig wrote:
  >>  +#ifndef __ARCH_IRQ_STAT irq_cpustat_t irq_stat[NR_CPUS]
  >> ____cacheline_aligned; +EXPORT_SYMBOL(irq_stat); +#endif

  Andi> Shouldn't this be per_cpu_data ?

That's what we do on ia64.  Though we actually end up putting it in
the cpuinfo structure, for historical reasons but also to ensure that
it's close to some other stuff that's used on the irq path.

	--david

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

* Re: [PATCH][RFC] fixing the irqwcpustat mess
  2003-05-07  4:30   ` David Mosberger-Tang
@ 2003-05-07  4:49     ` Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2003-05-07  4:49 UTC (permalink / raw)
  To: David.Mosberger; +Cc: Christoph Hellwig, davidm, linux-kernel

On Wed, 2003-05-07 at 06:30, David Mosberger-Tang wrote:
> >>>>> On 07 May 2003 06:24:54 +0200, Andi Kleen <ak@suse.de> said:
> 
>   Andi> On Mon, 2003-05-05 at 21:25, Christoph Hellwig wrote:
>   >>  +#ifndef __ARCH_IRQ_STAT irq_cpustat_t irq_stat[NR_CPUS]
>   >> ____cacheline_aligned; +EXPORT_SYMBOL(irq_stat); +#endif
> 
>   Andi> Shouldn't this be per_cpu_data ?
> 
> That's what we do on ia64.  Though we actually end up putting it in
> the cpuinfo structure, for historical reasons but also to ensure that
> it's close to some other stuff that's used on the irq path.

x86-64 does the same (putting it into the PDA). Was just commenting
generically for the other ports.

-Andi



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

* Re: [PATCH][RFC] fixing the irqwcpustat mess
  2003-05-07  4:24 ` Andi Kleen
  2003-05-07  4:30   ` David Mosberger-Tang
@ 2003-05-07  5:24   ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2003-05-07  5:24 UTC (permalink / raw)
  To: Andi Kleen; +Cc: davidm, linux-kernel

On Wed, May 07, 2003 at 06:24:54AM +0200, Andi Kleen wrote:
> On Mon, 2003-05-05 at 21:25, Christoph Hellwig wrote:
> 
> >  
> > +#ifndef __ARCH_IRQ_STAT
> >  irq_cpustat_t irq_stat[NR_CPUS] ____cacheline_aligned;
> > +EXPORT_SYMBOL(irq_stat);
> > +#endif
> 
> Shouldn't this be per_cpu_data ?

Yes, it should.  I have a patch for this but it' a separate issue.

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

end of thread, other threads:[~2003-05-07  5:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05 19:25 [PATCH][RFC] fixing the irqwcpustat mess Christoph Hellwig
2003-05-05 21:37 ` David Mosberger
2003-05-07  4:24 ` Andi Kleen
2003-05-07  4:30   ` David Mosberger-Tang
2003-05-07  4:49     ` Andi Kleen
2003-05-07  5:24   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).