diff options
author | julian <julian@FreeBSD.org> | 2004-09-03 07:42:31 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-09-03 07:42:31 +0000 |
commit | 373bbfc18445a9c3d361d56b73a25f76cbb6fb62 (patch) | |
tree | e4c143c3e33969a9055f5fb7df29532156d2a7ea /sys/kern/subr_smp.c | |
parent | ee581aec84758a98f561f58a0da3f17a02c9a97a (diff) | |
download | FreeBSD-src-373bbfc18445a9c3d361d56b73a25f76cbb6fb62.zip FreeBSD-src-373bbfc18445a9c3d361d56b73a25f76cbb6fb62.tar.gz |
Move 4bsd specific experimental IP code into the 4bsd file.
Move the sysctls into kern.sched
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 131 |
1 files changed, 1 insertions, 130 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 84f6160..eb06559 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -60,7 +60,7 @@ cpumask_t logical_cpus_mask; void (*cpustop_restartfunc)(void); #endif -/* amazingly enough this is used in non SMP code XXX BUG! */ +/* This is used in modules that need to work in both SMP and UP. */ cpumask_t all_cpus; int mp_ncpus; @@ -102,46 +102,6 @@ SYSCTL_INT(_kern_smp, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW, &forward_roundrobin_enabled, 0, "Forwarding of roundrobin to all other CPUs"); -#ifdef SCHED_4BSD -/* Enable forwarding of wakeups to all other cpus */ -SYSCTL_NODE(_kern_smp, OID_AUTO, ipiwakeup, CTLFLAG_RD, NULL, "Kernel SMP"); - -static int forward_wakeup_enabled = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, enabled, CTLFLAG_RW, - &forward_wakeup_enabled, 0, - "Forwarding of wakeup to idle CPUs"); - -static int forward_wakeups_requested = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, requested, CTLFLAG_RD, - &forward_wakeups_requested, 0, - "Requests for Forwarding of wakeup to idle CPUs"); - -static int forward_wakeups_delivered = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, delivered, CTLFLAG_RD, - &forward_wakeups_delivered, 0, - "Completed Forwarding of wakeup to idle CPUs"); - -static int forward_wakeup_use_mask = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, usemask, CTLFLAG_RW, - &forward_wakeup_use_mask, 0, - "Use the mask of idle cpus"); - -static int forward_wakeup_use_loop = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, useloop, CTLFLAG_RW, - &forward_wakeup_use_loop, 0, - "Use a loop to find idle cpus"); - -static int forward_wakeup_use_single = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, onecpu, CTLFLAG_RW, - &forward_wakeup_use_single, 0, - "Only signal one idle cpu"); - -static int forward_wakeup_use_htt = 0; -SYSCTL_INT(_kern_smp_ipiwakeup, OID_AUTO, htt2, CTLFLAG_RW, - &forward_wakeup_use_htt, 0, - "account for htt"); - -#endif /* SCHED_4BSD */ /* Variables needed for SMP rendezvous. */ static void (*smp_rv_setup_func)(void *arg); static void (*smp_rv_action_func)(void *arg); @@ -249,95 +209,6 @@ forward_roundrobin(void) ipi_selected(map, IPI_AST); } -#ifdef SCHED_4BSD -/* enable HTT_2 if you have a 2-way HTT cpu.*/ -int -forward_wakeup(int cpunum) -{ - cpumask_t map, me, dontuse; - cpumask_t map2; - struct pcpu *pc; - cpumask_t id, map3; - - mtx_assert(&sched_lock, MA_OWNED); - - CTR0(KTR_SMP, "forward_wakeup()"); - - if ((!forward_wakeup_enabled) || - (forward_wakeup_use_mask == 0 && forward_wakeup_use_loop == 0)) - return (0); - if (!smp_started || cold || panicstr) - return (0); - - forward_wakeups_requested++; - -/* - * check the idle mask we received against what we calculated before - * in the old version. - */ - me = PCPU_GET(cpumask); - /* - * don't bother if we should be doing it ourself.. - */ - if ((me & idle_cpus_mask) && (cpunum == NOCPU || me == (1 << cpunum))) - return (0); - - dontuse = me | stopped_cpus | hlt_cpus_mask; - map3 = 0; - if (forward_wakeup_use_loop) { - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - id = pc->pc_cpumask; - if ( (id & dontuse) == 0 && - pc->pc_curthread == pc->pc_idlethread) { - map3 |= id; - } - } - } - - if (forward_wakeup_use_mask) { - map = 0; - map = idle_cpus_mask & ~dontuse; - - /* If they are both on, compare and use loop if different */ - if (forward_wakeup_use_loop) { - if (map != map3) { - printf("map (%02X) != map3 (%02X)\n", - map, map3); - map = map3; - } - } - } else { - map = map3; - } - /* If we only allow a specific CPU, then mask off all the others */ - if (cpunum != NOCPU) { - KASSERT((cpunum <= mp_maxcpus),("forward_wakeup: bad cpunum.")); - map &= (1 << cpunum); - } else { - /* Try choose an idle die. */ - if (forward_wakeup_use_htt) { - map2 = (map & (map >> 1)) & 0x5555; - if (map2) { - map = map2; - } - } - - /* set only one bit */ - if (forward_wakeup_use_single) { - map = map & ((~map) + 1); - } - } - if (map) { - forward_wakeups_delivered++; - ipi_selected(map, IPI_AST); - return (1); - } - if (cpunum == NOCPU) - printf("forward_wakeup: Idle processor not found\n"); - return (0); -} -#endif /* SCHED_4BSD */ - /* * When called the executing CPU will send an IPI to all other CPUs * requesting that they halt execution. |