diff options
author | jb <jb@FreeBSD.org> | 2006-10-26 21:42:22 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 2006-10-26 21:42:22 +0000 |
commit | f82c7997354f95e680341bb8e10136ded5fd15eb (patch) | |
tree | 2136d90e7e60f4ef25fe147499787d0e6a155b82 /sys/kern/kern_clock.c | |
parent | b3e38fbc69f126c6cc49a0a6e45096d6c01b7c43 (diff) | |
download | FreeBSD-src-f82c7997354f95e680341bb8e10136ded5fd15eb.zip FreeBSD-src-f82c7997354f95e680341bb8e10136ded5fd15eb.tar.gz |
Make KSE a kernel option, turned on by default in all GENERIC
kernel configs except sun4v (which doesn't process signals properly
with KSE).
Reviewed by: davidxu@
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r-- | sys/kern/kern_clock.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index ea1a6f1..cd98bdd 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -202,6 +202,7 @@ hardclock_cpu(int usermode) */ mtx_lock_spin_flags(&sched_lock, MTX_QUIET); sched_tick(); +#ifdef KSE if (p->p_flag & P_SA) { /* XXXKSE What to do? */ } else { @@ -218,6 +219,20 @@ hardclock_cpu(int usermode) td->td_flags |= TDF_ASTPENDING; } } +#else + pstats = p->p_stats; + if (usermode && + timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) { + p->p_sflag |= PS_ALRMPEND; + td->td_flags |= TDF_ASTPENDING; + } + if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value) && + itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) { + p->p_sflag |= PS_PROFPEND; + td->td_flags |= TDF_ASTPENDING; + } +#endif mtx_unlock_spin_flags(&sched_lock, MTX_QUIET); #ifdef HWPMC_HOOKS @@ -414,8 +429,10 @@ statclock(int usermode) /* * Charge the time as appropriate. */ +#ifdef KSE if (p->p_flag & P_SA) thread_statclock(1); +#endif td->td_uticks++; if (p->p_nice > NZERO) cp_time[CP_NICE]++; @@ -439,8 +456,10 @@ statclock(int usermode) td->td_iticks++; cp_time[CP_INTR]++; } else { +#ifdef KSE if (p->p_flag & P_SA) thread_statclock(0); +#endif td->td_pticks++; td->td_sticks++; if (td != PCPU_GET(idlethread)) |