From b1ac98d8b27a21983ff38293ee3bb7e961552a64 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Fri, 2 May 2003 00:33:12 +0000 Subject: [PATCH] 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) --- sys/kern/kern_idle.c | 2 +- sys/kern/kern_intr.c | 2 +- sys/kern/kern_ktr.c | 2 +- sys/kern/sched_ule.c | 2 +- sys/sys/proc.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index a3a949516fa9..825b2f04189e 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -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 diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 5a1a0c2ba677..3405687a9ee3 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -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 { diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index 35a15fd6a0f2..245440681986 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -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; diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index e3c5a8eb1f0e..49329f9f91d3 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -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)", diff --git a/sys/sys/proc.h b/sys/sys/proc.h index ab6950ee6b0f..92f97396287a 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -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. */