aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sched_ule.c
diff options
context:
space:
mode:
authorRyan Stone <rstone@FreeBSD.org>2017-02-16 21:18:31 +0000
committerRyan Stone <rstone@FreeBSD.org>2017-02-16 21:18:31 +0000
commit27ee18ad336ae50bc29692275768befa0ee9b564 (patch)
tree5636ae0732cd55cbf5f57884d662d6bae243a170 /sys/kern/sched_ule.c
parentb0f512390e86daee1ce93931faa7509e152f381f (diff)
downloadsrc-27ee18ad336ae50bc29692275768befa0ee9b564.tar.gz
src-27ee18ad336ae50bc29692275768befa0ee9b564.zip
Revert r313814 and r313816
Something evidently got mangled in my git tree in between testing and review, as an old and broken version of the patch was apparently submitted to svn. Revert this while I work out what went wrong. Reported by: tuexen Pointy hat to: rstone
Notes
Notes: svn path=/head/; revision=313824
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r--sys/kern/sched_ule.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 93644469ce53..b650f24db9e5 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct thread *, int);
#ifdef SMP
static int tdq_move(struct tdq *, struct tdq *);
static int tdq_idled(struct tdq *);
-static void tdq_notify(struct tdq *, int);
+static void tdq_notify(struct tdq *, struct thread *);
static struct thread *tdq_steal(struct tdq *, int);
static struct thread *runq_steal(struct runq *, int);
static int sched_pickcpu(struct thread *, int);
@@ -1040,14 +1040,16 @@ tdq_idled(struct tdq *tdq)
* Notify a remote cpu of new work. Sends an IPI if criteria are met.
*/
static void
-tdq_notify(struct tdq *tdq, int pri)
+tdq_notify(struct tdq *tdq, struct thread *td)
{
struct thread *ctd;
+ int pri;
int cpu;
if (tdq->tdq_ipipending)
return;
- cpu = TDQ_ID(tdq);
+ cpu = td_get_sched(td)->ts_cpu;
+ pri = td->td_priority;
ctd = pcpu_find(cpu)->pc_curthread;
if (!sched_shouldpreempt(pri, ctd->td_priority, 1))
return;
@@ -1673,22 +1675,6 @@ sched_pctcpu_update(struct td_sched *ts, int run)
ts->ts_ltick = t;
}
-static void
-sched_check_preempt(struct tdq *tdq, struct thread *td)
-{
-
- KASSERT(TD_IS_RUNNING(td), ("thread is not running"));
- TDQ_LOCK_ASSERT(tdq, MA_OWNED);
- KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu),
- ("tdq does not contain td"));
-
- if (tdq == TDQ_SELF()) {
- if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, 0))
- td->td_owepreempt = 1;
- } else
- tdq_notify(tdq, tdq->tdq_lowpri);
-}
-
/*
* Adjust the priority of a thread. Move it to the appropriate run-queue
* if necessary. This is the back-end for several priority related
@@ -1740,9 +1726,6 @@ sched_thread_priority(struct thread *td, u_char prio)
tdq->tdq_lowpri = prio;
else if (tdq->tdq_lowpri == oldpri)
tdq_setlowpri(tdq, td);
-
- if (oldpri < prio)
- sched_check_preempt(tdq, td);
return;
}
td->td_priority = prio;
@@ -1871,7 +1854,7 @@ sched_switch_migrate(struct tdq *tdq, struct thread *td, int flags)
*/
tdq_lock_pair(tdn, tdq);
tdq_add(tdn, td, flags);
- tdq_notify(tdn, td->td_priority);
+ tdq_notify(tdn, td);
TDQ_UNLOCK(tdn);
spinlock_exit();
#endif
@@ -2446,7 +2429,7 @@ sched_add(struct thread *td, int flags)
tdq = sched_setcpu(td, cpu, flags);
tdq_add(tdq, td, flags);
if (cpu != PCPU_GET(cpuid)) {
- tdq_notify(tdq, td->td_priority);
+ tdq_notify(tdq, td);
return;
}
#else