diff --git a/sys/ia64/conf/GENERIC b/sys/ia64/conf/GENERIC index 8c4a0af9f578..6a4baeedef21 100644 --- a/sys/ia64/conf/GENERIC +++ b/sys/ia64/conf/GENERIC @@ -48,7 +48,7 @@ options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as root device options PROCFS # Process filesystem (/proc) options PSEUDOFS # Pseudo-filesystem framework -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options SCTP # Stream Control Transmission Protocol options SMP # Symmetric Multi-Processor support diff --git a/sys/ia64/conf/SKI b/sys/ia64/conf/SKI index 6e2a4baba996..377ee9386cee 100644 --- a/sys/ia64/conf/SKI +++ b/sys/ia64/conf/SKI @@ -35,8 +35,8 @@ options KTRACE # ktrace(1) syscall trace support options MD_ROOT # MD usable as root device options PROCFS # Process filesystem (/proc) options PSEUDOFS # Pseudo-filesystem framework -options SCHED_4BSD # 4BSD scheduler -#options SCHED_ULE # ULE scheduler +#options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler options SKI # Include SKI support code options SOFTUPDATES # Enable FFS soft updates support options SYSVMSG # SYSV-style message queues diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index c3dd83d4451a..15783c9e8d61 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -241,6 +242,9 @@ interrupt(struct trapframe *tf) } else if (vector == ipi_vector[IPI_TEST]) { CTR1(KTR_SMP, "IPI_TEST, cpuid=%d", PCPU_GET(cpuid)); mp_ipi_test++; + } else if (vector == ipi_vector[IPI_PREEMPT]) { + CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); + sched_preempt(curthread); #endif } else { ints[PCPU_GET(cpuid)]++; diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 149c704b6dce..7ce78b8b0c1a 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_msgbuf.h" +#include "opt_sched.h" #include #include @@ -370,6 +371,12 @@ cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx) if (PCPU_GET(fpcurthread) == old) old->td_frame->tf_special.psr |= IA64_PSR_DFH; if (!savectx(oldpcb)) { + old->td_lock = mtx; +#if defined(SCHED_ULE) && defined(SMP) + /* td_lock is volatile */ + while (new->td_lock == &blocked_lock) + ; +#endif newpcb = new->td_pcb; oldpcb->pcb_current_pmap = pmap_switch(newpcb->pcb_current_pmap); @@ -890,12 +897,16 @@ DELAY(int n) { u_int64_t start, end, now; + sched_pin(); + start = ia64_get_itc(); end = start + (itc_frequency * n) / 1000000; /* printf("DELAY from 0x%lx to 0x%lx\n", start, end); */ do { now = ia64_get_itc(); } while (now < end || (now > start && end < start)); + + sched_unpin(); } /* diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index a1c062110075..911b169ce85d 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(__i386__) && !defined(__amd64__) && !defined(__powerpc__) && !defined(__arm__) +#if defined(__sparc64__) || defined(__mips__) #error "This architecture is not currently compatible with ULE" #endif