From a7a8bac81f171b93c4770f51c694b15c84a2f9f8 Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 1 Jun 2007 01:12:45 +0000 Subject: - Move rusage from being per-process in struct pstats to per-thread in td_ru. This removes the requirement for per-process synchronization in statclock() and mi_switch(). This was previously supported by sched_lock which is going away. All modifications to rusage are now done in the context of the owning thread. reads proceed without locks. - Aggregate exiting threads rusage in thread_exit() such that the exiting thread's rusage is not lost. - Provide a new routine, rufetch() to fetch an aggregate of all rusage structures from all threads in a process. This routine must be used in any place requiring a rusage from a process prior to it's exit. The exited process's rusage is still available via p_ru. - Aggregate tick statistics only on demand via rufetch() or when a thread exits. Tick statistics are kept in the thread and protected by sched_lock until it exits. Initial patch by: attilio Reviewed by: attilio, bde (some objections), arch (mostly silent) --- sys/kern/kern_sig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_sig.c') diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index fe2bbbe..dc02346 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1868,7 +1868,7 @@ trapsignal(struct thread *td, ksiginfo_t *ksi) mtx_lock(&ps->ps_mtx); if ((p->p_flag & P_TRACED) == 0 && SIGISMEMBER(ps->ps_sigcatch, sig) && !SIGISMEMBER(td->td_sigmask, sig)) { - p->p_stats->p_ru.ru_nsignals++; + td->td_ru.ru_nsignals++; #ifdef KTRACE if (KTRPOINT(curthread, KTR_PSIG)) ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)], @@ -2781,7 +2781,7 @@ postsig(sig) SIGADDSET(ps->ps_sigignore, sig); ps->ps_sigact[_SIG_IDX(sig)] = SIG_DFL; } - p->p_stats->p_ru.ru_nsignals++; + td->td_ru.ru_nsignals++; if (p->p_sig != sig) { code = 0; } else { -- cgit v1.1