Move the flag that indicates an idle thread from the KSE to the thread.
It was always referenced via the thread anyhow. Reviewed by: jhb (a LOOOOONG time ago)
This commit is contained in:
parent
8705f13eab
commit
b1ac98d8b2
@ -67,7 +67,7 @@ idle_setup(void *dummy)
|
||||
p->p_state = PRS_NORMAL;
|
||||
td = FIRST_THREAD_IN_PROC(p);
|
||||
td->td_state = TDS_CAN_RUN;
|
||||
td->td_kse->ke_flags |= KEF_IDLEKSE;
|
||||
td->td_flags |= TDF_IDLETD;
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
PROC_UNLOCK(p);
|
||||
#ifdef SMP
|
||||
|
@ -397,7 +397,7 @@ ithread_schedule(struct ithd *ithread, int do_switch)
|
||||
KASSERT((TD_IS_RUNNING(ctd)),
|
||||
("ithread_schedule: Bad state for curthread."));
|
||||
ctd->td_proc->p_stats->p_ru.ru_nivcsw++;
|
||||
if (ctd->td_kse->ke_flags & KEF_IDLEKSE)
|
||||
if (ctd->td_flags & TDF_IDLETD)
|
||||
ctd->td_state = TDS_CAN_RUN; /* XXXKSE */
|
||||
mi_switch();
|
||||
} else {
|
||||
|
@ -195,7 +195,7 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format,
|
||||
#ifdef KTR_ALQ
|
||||
if (ktr_alq_enabled &&
|
||||
td->td_critnest == 0 &&
|
||||
(td->td_kse->ke_flags & KEF_IDLEKSE) == 0 &&
|
||||
(td->td_flags & TDF_IDLETD) == 0 &&
|
||||
td != ald_thread) {
|
||||
if (ktr_alq_max && ktr_alq_cnt > ktr_alq_max)
|
||||
goto done;
|
||||
|
@ -901,7 +901,7 @@ sched_clock(struct kse *ke)
|
||||
if (ke->ke_ftick + SCHED_CPU_TICKS + hz < ke->ke_ltick)
|
||||
sched_pctcpu_update(ke);
|
||||
|
||||
if (td->td_kse->ke_flags & KEF_IDLEKSE)
|
||||
if (td->td_flags & TD_IDLETD)
|
||||
return;
|
||||
|
||||
CTR4(KTR_ULE, "Tick kse %p (slice: %d, slptime: %d, runtime: %d)",
|
||||
|
@ -350,6 +350,7 @@ struct thread {
|
||||
#define TDF_CAN_UNBIND 0x000004 /* Only temporarily bound. */
|
||||
#define TDF_SINTR 0x000008 /* Sleep is interruptible. */
|
||||
#define TDF_TIMEOUT 0x000010 /* Timing out during sleep. */
|
||||
#define TDF_IDLETD 0x000020 /* This is one of the per-CPU idle threads */
|
||||
#define TDF_SELECT 0x000040 /* Selecting; wakeup/waiting danger. */
|
||||
#define TDF_CVWAITQ 0x000080 /* Thread is on a cv_waitq (not slpq). */
|
||||
#define TDF_UPCALLING 0x000100 /* This thread is doing an upcall. */
|
||||
@ -450,7 +451,6 @@ struct kse {
|
||||
};
|
||||
|
||||
/* flags kept in ke_flags */
|
||||
#define KEF_IDLEKSE 0x00004 /* A 'Per CPU idle process'.. has one thread */
|
||||
#define KEF_DIDRUN 0x02000 /* KSE actually ran. */
|
||||
#define KEF_EXIT 0x04000 /* KSE is being killed. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user