From ccd0ec406677d50d17580ff87c50993f6a78bfe2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 17 Apr 2016 11:04:27 +0000 Subject: The struct thread td_estcpu member is only used by the 4BSD scheduler. Move it to the struct td_sched for 4BSD, removing always present field, otherwise unused for ULE. New scheduler method sched_estcpu() returns the estimation for kinfo_proc consumption. As before, it always returns 0 for ULE. Remove sched_tick() scheduler method, unused both by 4BSD and ULE. Update locking comment for the 4BSD struct td_sched, copying it from the same comment for ULE. Spell MAXPRI as PRI_MAX_TIMESHARE in the 4BSD comment. Based on some notes from, and reviewed by: bde Sponsored by: The FreeBSD Foundation --- sys/kern/kern_proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_proc.c') diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 9a41165b8f80..3b220c38e0b3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -855,7 +855,7 @@ fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp) FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); kp->ki_pctcpu += sched_pctcpu(td); - kp->ki_estcpu += td->td_estcpu; + kp->ki_estcpu += sched_estcpu(td); thread_unlock(td); } } @@ -1101,7 +1101,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread) rufetchtd(td, &kp->ki_rusage); kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime); kp->ki_pctcpu = sched_pctcpu(td); - kp->ki_estcpu = td->td_estcpu; + kp->ki_estcpu = sched_estcpu(td); kp->ki_cow = td->td_cow; } -- cgit v1.2.3