Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386 Do softints purely in software.
details: https://anonhg.NetBSD.org/src/rev/54fc304ca800
branches: sommerfeld_i386mp_1
changeset: 482386:54fc304ca800
user: sommerfeld <sommerfeld%NetBSD.org@localhost>
date: Mon Apr 30 20:36:37 2001 +0000
description:
Do softints purely in software.
Using the local apic for softints is slow; exactly why isn't clear,
but ripping out the code and using pure-software softints speeds up
ping -f packet rates by more than 5%.
diffstat:
sys/arch/i386/i386/apicvec.s | 59 +--------------------------------------
sys/arch/i386/i386/lapic.c | 7 +---
sys/arch/i386/include/i82489var.h | 14 +--------
sys/arch/i386/include/intr.h | 22 +++-----------
4 files changed, 8 insertions(+), 94 deletions(-)
diffs (176 lines):
diff -r 108b5f457ffc -r 54fc304ca800 sys/arch/i386/i386/apicvec.s
--- a/sys/arch/i386/i386/apicvec.s Mon Apr 30 16:58:34 2001 +0000
+++ b/sys/arch/i386/i386/apicvec.s Mon Apr 30 20:36:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apicvec.s,v 1.1.2.5 2001/04/30 16:23:09 sommerfeld Exp $ */
+/* $NetBSD: apicvec.s,v 1.1.2.6 2001/04/30 20:36:37 sommerfeld Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -92,63 +92,6 @@
addl $4,%esp
jmp _C_LABEL(Xdoreti)
- .globl XINTR(softclock), XINTR(softnet), XINTR(softser)
-XINTR(softclock):
- pushl $0
- pushl $T_ASTFLT
- INTRENTRY
- MAKE_FRAME
- pushl CPL
- movl $IPL_SOFTCLOCK,CPL
- andl $~(1<<SIR_CLOCK),_C_LABEL(ipending)
- movl $0,_C_LABEL(local_apic)+LAPIC_EOI
- sti
- call _C_LABEL(apic_intlock)
- pushl $I386_SOFTINTR_SOFTCLOCK
- call _C_LABEL(softintr_dispatch)
- addl $4,%esp
- call _C_LABEL(apic_intunlock)
- jmp _C_LABEL(Xdoreti)
-
-XINTR(softnet):
- pushl $0
- pushl $T_ASTFLT
- INTRENTRY
- MAKE_FRAME
- pushl CPL
- movl $IPL_SOFTNET,CPL
- andl $~(1<<SIR_NET),_C_LABEL(ipending)
- movl $0,_C_LABEL(local_apic)+LAPIC_EOI
- sti
- call _C_LABEL(apic_intlock)
- xorl %edi,%edi
- xchgl _C_LABEL(netisr),%edi
-
-#include "net/netisr_dispatch.h"
-
- pushl $I386_SOFTINTR_SOFTNET
- call _C_LABEL(softintr_dispatch)
- addl $4,%esp
- call _C_LABEL(apic_intunlock)
- jmp _C_LABEL(Xdoreti)
-
-XINTR(softser):
- pushl $0
- pushl $T_ASTFLT
- INTRENTRY
- MAKE_FRAME
- pushl CPL
- movl $IPL_SOFTSERIAL,CPL
- andl $~(1<<SIR_SERIAL),_C_LABEL(ipending)
- movl $0,_C_LABEL(local_apic)+LAPIC_EOI
- sti
- call _C_LABEL(apic_intlock)
- pushl $I386_SOFTINTR_SOFTSERIAL
- call _C_LABEL(softintr_dispatch)
- addl $4,%esp
- call _C_LABEL(apic_intunlock)
- jmp _C_LABEL(Xdoreti)
-
#if NIOAPIC > 0
/*
* I/O APIC interrupt.
diff -r 108b5f457ffc -r 54fc304ca800 sys/arch/i386/i386/lapic.c
--- a/sys/arch/i386/i386/lapic.c Mon Apr 30 16:58:34 2001 +0000
+++ b/sys/arch/i386/i386/lapic.c Mon Apr 30 20:36:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.1.2.12 2001/01/04 04:44:32 thorpej Exp $ */
+/* $NetBSD: lapic.c,v 1.1.2.13 2001/04/30 20:36:38 sommerfeld Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -164,11 +164,6 @@
#endif
idt_vec_set(LAPIC_SPURIOUS_VECTOR, Xintrspurious);
idt_vec_set(LAPIC_TIMER_VECTOR, Xintrltimer);
-
- idt_vec_set(LAPIC_SOFTCLOCK_VECTOR, Xintrsoftclock);
- idt_vec_set(LAPIC_SOFTNET_VECTOR, Xintrsoftnet);
- idt_vec_set(LAPIC_SOFTSER_VECTOR, Xintrsoftser);
-
}
static inline u_int32_t lapic_gettick()
diff -r 108b5f457ffc -r 54fc304ca800 sys/arch/i386/include/i82489var.h
--- a/sys/arch/i386/include/i82489var.h Mon Apr 30 16:58:34 2001 +0000
+++ b/sys/arch/i386/include/i82489var.h Mon Apr 30 20:36:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82489var.h,v 1.1.2.3 2000/08/12 16:14:10 sommerfeld Exp $ */
+/* $NetBSD: i82489var.h,v 1.1.2.4 2001/04/30 20:36:38 sommerfeld Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -85,18 +85,6 @@
extern void Xintrltimer(void);
#define LAPIC_TIMER_VECTOR 0xd0
-/*
- * Vectors to be used for self-soft-interrupts.
- */
-
-#define LAPIC_SOFTCLOCK_VECTOR IPL_SOFTCLOCK
-#define LAPIC_SOFTNET_VECTOR IPL_SOFTNET
-#define LAPIC_SOFTSER_VECTOR IPL_SOFTSERIAL
-
-extern void Xintrsoftclock(void);
-extern void Xintrsoftnet(void);
-extern void Xintrsoftser(void);
-
extern void (*apichandler[]) __P((void));
struct cpu_info;
diff -r 108b5f457ffc -r 54fc304ca800 sys/arch/i386/include/intr.h
--- a/sys/arch/i386/include/intr.h Mon Apr 30 16:58:34 2001 +0000
+++ b/sys/arch/i386/include/intr.h Mon Apr 30 20:36:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.12.10.12 2001/04/30 16:58:34 sommerfeld Exp $ */
+/* $NetBSD: intr.h,v 1.12.10.13 2001/04/30 20:36:38 sommerfeld Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -84,11 +84,6 @@
#ifndef _LOCORE
-#ifdef MULTIPROCESSOR
-#include <machine/i82489reg.h>
-#include <machine/i82489var.h>
-#endif
-
extern volatile u_int32_t lapic_tpr;
volatile u_int32_t ipending;
@@ -182,21 +177,12 @@
softintr(register int sir)
{
__asm __volatile("orl %1, %0" : "=m"(ipending) : "ir" (1 << sir));
-#if 0
-#ifdef MULTIPROCESSOR
- i82489_writereg(LAPIC_ICRLO,
- vec | LAPIC_DLMODE_FIXED | LAPIC_LVL_ASSERT | LAPIC_DEST_SELF);
-#endif
-#endif
}
-#if 0
-#define setsoftclock() softintr(SIR_CLOCK,IPL_SOFTCLOCK)
-#define setsoftserial() softintr(SIR_SERIAL,IPL_SOFTSERIAL)
-#define setsoftnet() softintr(SIR_NET,IPL_SOFTNET)
-#endif
#define setsoftnet() softintr(SIR_NET)
+/* XXX does ipi goo belong here, or elsewhere? */
+
#define I386_IPI_HALT 0x00000001
#define I386_IPI_FLUSH_FPU 0x00000002
#define I386_IPI_SYNCH_FPU 0x00000004
@@ -206,6 +192,8 @@
#define I386_NIPI 5
#ifdef MULTIPROCESSOR
+struct cpu_info;
+
void i386_send_ipi (struct cpu_info *, int);
void i386_broadcast_ipi (int);
void i386_multicast_ipi (int, int);
Home |
Main Index |
Thread Index |
Old Index