static void bsd4_need_user_resched_remote(void *dummy);
static int bsd4_batchy_looser_pri_test(struct lwp* lp);
static struct lwp *bsd4_chooseproc_locked_cache_coherent(struct lwp *chklp);
+static void bsd4_kick_helper(struct lwp *lp);
#endif
static struct lwp *bsd4_chooseproc_locked(struct lwp *chklp);
static void bsd4_remrunqueue_locked(struct lwp *lp);
static void bsd4_setrunqueue_locked(struct lwp *lp);
-static void bsd4_kick_helper(struct lwp *lp);
struct usched usched_bsd4 = {
{ NULL },
static int usched_bsd4_upri_affinity = 16; /* 32 queues - half-way */
static int usched_bsd4_queue_checks = 5;
static int usched_bsd4_stick_to_level = 0;
+static long usched_bsd4_kicks;
#endif
static int usched_bsd4_rrinterval = (ESTCPUFREQ + 9) / 10;
static int usched_bsd4_decay = 8;
static int usched_bsd4_batch_time = 10;
-static long usched_bsd4_kicks;
/* KTR debug printings */
struct lwp *nlp;
cpumask_t mask;
int cpuid;
-#ifdef SMP
cpumask_t tmpmask;
int tmpid;
-#endif
gd = mycpu;
cpuid = gd->gd_cpuid; /* doesn't change */
dd->uschedcp = nlp;
dd->rrcount = 0; /* reset round robin */
spin_unlock(&bsd4_spin);
-#ifdef SMP
lwkt_acquire(nlp->lwp_thread);
-#endif
lwkt_schedule(nlp->lwp_thread);
} else {
spin_unlock(&bsd4_spin);
dd->uschedcp = nlp;
dd->rrcount = 0; /* reset round robin */
spin_unlock(&bsd4_spin);
-#ifdef SMP
lwkt_acquire(nlp->lwp_thread);
-#endif
lwkt_schedule(nlp->lwp_thread);
} else {
/*
* if supported
*/
if (cache_coherent_not_supported) {
-#ifdef SMP
usched_bsd4_cache_coherent = 0;
SYSCTL_ADD_STRING(&usched_bsd4_sysctl_ctx,
SYSCTL_CHILDREN(usched_bsd4_sysctl_tree),
OID_AUTO, "cache_coherent", CTLFLAG_RD,
"NOT SUPPORTED", 0,
"Cache coherence NOT SUPPORTED");
-#endif
} else {
-#ifdef SMP
usched_bsd4_cache_coherent = 1;
SYSCTL_ADD_INT(&usched_bsd4_sysctl_ctx,
SYSCTL_CHILDREN(usched_bsd4_sysctl_tree),
OID_AUTO, "cache_coherent", CTLFLAG_RW,
&usched_bsd4_cache_coherent, 0,
"Enable/Disable cache coherent scheduling");
-#endif
SYSCTL_ADD_INT(&usched_bsd4_sysctl_ctx,
SYSCTL_CHILDREN(usched_bsd4_sysctl_tree),
SYSINIT(uschedtd, SI_BOOT2_USCHED, SI_ORDER_SECOND,
sched_sysctl_tree_init, NULL)
#endif
-
static int usched_dfly_rrinterval = (ESTCPUFREQ + 9) / 10;
static int usched_dfly_decay = 8;
static int usched_dfly_batch_time = 10;
-static long usched_dfly_kicks;
/* KTR debug printings */
if (rdd->uschedcp == NULL) {
spin_lock(&rdd->spin);
if (rdd->uschedcp == NULL) {
- atomic_set_cpumask(&dfly_curprocmask, gd->gd_cpumask);
+ atomic_set_cpumask(&dfly_curprocmask, rgd->gd_cpumask);
rdd->uschedcp = lp;
rdd->upri = lp->lwp_priority;
spin_unlock(&rdd->spin);
struct lwp *
dfly_chooseproc_locked(dfly_pcpu_t dd, struct lwp *chklp, int isremote)
{
+#ifdef SMP
dfly_pcpu_t xdd;
+#endif
struct lwp *lp;
struct rq *q;
u_int32_t *which, *which2;
dd->rrcount = 0; /* reset round robin */
spin_unlock(&dd->spin);
/*spin_unlock(&dfly_spin);*/
-#ifdef SMP
lwkt_acquire(nlp->lwp_thread);
-#endif
lwkt_schedule(nlp->lwp_thread);
} else {
spin_unlock(&dd->spin);
dd->rrcount = 0; /* reset round robin */
spin_unlock(&dd->spin);
/*spin_unlock(&dfly_spin);*/
-#ifdef SMP
lwkt_acquire(nlp->lwp_thread);
-#endif
lwkt_schedule(nlp->lwp_thread);
} else {
/*
SYSCTL_CHILDREN(usched_dfly_sysctl_tree),
OID_AUTO, "batch_time", CTLFLAG_RW,
&usched_dfly_batch_time, 0, "Min batch counter value");
- SYSCTL_ADD_LONG(&usched_dfly_sysctl_ctx,
- SYSCTL_CHILDREN(usched_dfly_sysctl_tree),
- OID_AUTO, "kicks", CTLFLAG_RW,
- &usched_dfly_kicks, "Number of kickstarts");
/* Add enable/disable option for SMT scheduling if supported */
if (smt_not_supported) {
* if supported
*/
if (cache_coherent_not_supported) {
-#ifdef SMP
usched_dfly_cache_coherent = 0;
SYSCTL_ADD_STRING(&usched_dfly_sysctl_ctx,
SYSCTL_CHILDREN(usched_dfly_sysctl_tree),
OID_AUTO, "cache_coherent", CTLFLAG_RD,
"NOT SUPPORTED", 0,
"Cache coherence NOT SUPPORTED");
-#endif
} else {
-#ifdef SMP
usched_dfly_cache_coherent = 1;
SYSCTL_ADD_INT(&usched_dfly_sysctl_ctx,
SYSCTL_CHILDREN(usched_dfly_sysctl_tree),
OID_AUTO, "cache_coherent", CTLFLAG_RW,
&usched_dfly_cache_coherent, 0,
"Enable/Disable cache coherent scheduling");
-#endif
SYSCTL_ADD_INT(&usched_dfly_sysctl_ctx,
SYSCTL_CHILDREN(usched_dfly_sysctl_tree),