count ipis on smp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

count ipis on smp

Michael Shalayeff-2
re
apparently it's a good number to know of.
plz test.
cu

--
    paranoic mickey       (my employers have changed but, the name has remained)

Index: i386/ipifuncs.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/ipifuncs.c,v
retrieving revision 1.3
diff -u -r1.3 ipifuncs.c
--- i386/ipifuncs.c 16 Jun 2004 18:24:23 -0000 1.3
+++ i386/ipifuncs.c 10 Mar 2006 17:53:36 -0000
@@ -164,6 +164,7 @@
 void
 i386_ipi_handler(void)
 {
+ extern struct evcount ipi_count;
  struct cpu_info *ci = curcpu();
  u_int32_t pending;
  int bit;
@@ -174,6 +175,7 @@
  if (pending & (1<<bit)) {
  pending &= ~(1<<bit);
  (*ipifunc[bit])(ci);
+ ipi_count.ec_count++;
  }
  }
 }
Index: i386/lapic.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/lapic.c,v
retrieving revision 1.5
diff -u -r1.5 lapic.c
--- i386/lapic.c 28 Jun 2004 02:00:20 -0000 1.5
+++ i386/lapic.c 10 Mar 2006 17:53:36 -0000
@@ -64,6 +64,7 @@
 #include <i386/isa/timerreg.h> /* XXX for TIMER_FREQ */
 
 struct evcount clk_count;
+struct evcount ipi_count;
 
 void lapic_delay(int);
 void lapic_microtime(struct timeval *);
@@ -165,6 +166,7 @@
  paddr_t lapic_base;
 {
  static int clk_irq = 0;
+ static int ipi_irq = 0;
 
  lapic_map(lapic_base);
 
@@ -175,6 +177,7 @@
  idt_vec_set(LAPIC_TIMER_VECTOR, Xintrltimer);
 
  evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr);
+ evcount_attach(&ipi_count, "ipi", (void *)&ipi_irq, &evcount_intr);
 }
 
 static __inline u_int32_t

Reply | Threaded
Open this post in threaded view
|

Re: count ipis on smp

Michael Shalayeff-2
On Fri, Mar 10, 2006 at 06:56:22PM +0100, mickey wrote:
> re
> apparently it's a good number to know of.
> plz test.

as it has bin pointed out amd can use it too (:
cu
--
    paranoic mickey       (my employers have changed but, the name has remained)


Index: i386/ipifuncs.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/ipifuncs.c,v
retrieving revision 1.3
diff -u -r1.3 ipifuncs.c
--- i386/ipifuncs.c 16 Jun 2004 18:24:23 -0000 1.3
+++ i386/ipifuncs.c 10 Mar 2006 17:53:36 -0000
@@ -164,6 +164,7 @@
 void
 i386_ipi_handler(void)
 {
+ extern struct evcount ipi_count;
  struct cpu_info *ci = curcpu();
  u_int32_t pending;
  int bit;
@@ -174,6 +175,7 @@
  if (pending & (1<<bit)) {
  pending &= ~(1<<bit);
  (*ipifunc[bit])(ci);
+ ipi_count.ec_count++;
  }
  }
 }
Index: i386/lapic.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/lapic.c,v
retrieving revision 1.5
diff -u -r1.5 lapic.c
--- i386/lapic.c 28 Jun 2004 02:00:20 -0000 1.5
+++ i386/lapic.c 10 Mar 2006 17:53:36 -0000
@@ -64,6 +64,7 @@
 #include <i386/isa/timerreg.h> /* XXX for TIMER_FREQ */
 
 struct evcount clk_count;
+struct evcount ipi_count;
 
 void lapic_delay(int);
 void lapic_microtime(struct timeval *);
@@ -165,6 +166,7 @@
  paddr_t lapic_base;
 {
  static int clk_irq = 0;
+ static int ipi_irq = 0;
 
  lapic_map(lapic_base);
 
@@ -175,6 +177,7 @@
  idt_vec_set(LAPIC_TIMER_VECTOR, Xintrltimer);
 
  evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr);
+ evcount_attach(&ipi_count, "ipi", (void *)&ipi_irq, &evcount_intr);
 }
 
 static __inline u_int32_t
Index: amd64/lapic.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/lapic.c,v
retrieving revision 1.4
diff -u -r1.4 lapic.c
--- amd64/lapic.c 13 Dec 2005 23:33:25 -0000 1.4
+++ amd64/lapic.c 10 Mar 2006 19:49:24 -0000
@@ -64,6 +64,7 @@
 #include <machine/i82489var.h>
 
 struct evcount clk_count;
+struct evcount ipi_count;
 
 void lapic_delay(int);
 void lapic_microtime(struct timeval *);
@@ -197,6 +198,7 @@
  paddr_t lapic_base;
 {
  static u_int64_t clk_irq = 0;
+ static u_int64_t ipi_irq = 0;
 
  lapic_map(lapic_base);
 
@@ -211,6 +213,7 @@
  idt_vec_set(LAPIC_TIMER_VECTOR, Xintr_lapic_ltimer);
 
  evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr);
+ evcount_attach(&ipi_count, "ipi", (void *)&ipi_irq, &evcount_intr);
 }
 
 static inline u_int32_t lapic_gettick()
Index: amd64/ipi.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/ipi.c,v
retrieving revision 1.2
diff -u -r1.2 ipi.c
--- amd64/ipi.c 25 Sep 2005 20:48:18 -0000 1.2
+++ amd64/ipi.c 10 Mar 2006 19:49:24 -0000
@@ -126,6 +126,7 @@
 void
 x86_ipi_handler(void)
 {
+ extern struct evcount clk_count;
  struct cpu_info *ci = curcpu();
  u_int32_t pending;
  int bit;
@@ -137,6 +138,7 @@
  pending &= ~(1<<bit);
  ci->ci_ipi_events[bit].ev_count++;
  (*ipifunc[bit])(ci);
+ ipi_count.ec_count++;
  }
  }
 }

Reply | Threaded
Open this post in threaded view
|

Re: count ipis on smp

Otto Moerbeek
On Fri, 10 Mar 2006, mickey wrote:

> On Fri, Mar 10, 2006 at 06:56:22PM +0100, mickey wrote:
> > re
> > apparently it's a good number to know of.
> > plz test.
>

> Index: amd64/ipi.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/amd64/amd64/ipi.c,v
> retrieving revision 1.2
> diff -u -r1.2 ipi.c
> --- amd64/ipi.c 25 Sep 2005 20:48:18 -0000 1.2
> +++ amd64/ipi.c 10 Mar 2006 19:49:24 -0000
> @@ -126,6 +126,7 @@
>  void
>  x86_ipi_handler(void)
>  {
> + extern struct evcount clk_count;

Should be ipi_count

        -Otto