From 0cb3276d57e68364c5cd8f83dd504672a5e5f5b0 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 16 Jul 2004 21:04:55 +0000 Subject: - Move TDF_OWEPREEMPT, TDF_OWEUPC, and TDF_USTATCLOCK over to td_pflags since they are only accessed by curthread and thus do not need any locking. - Move pr_addr and pr_ticks out of struct uprof (which is per-process) and directly into struct thread as td_profil_addr and td_profil_ticks as these variables are really per-thread. (They are used to defer an addupc_intr() that was too "hard" until ast()). --- sys/kern/subr_trap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/kern/subr_trap.c') diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index b7b461e..664fe63 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -178,7 +178,7 @@ ast(struct trapframe *framep) p->p_sflag &= ~PS_MACPEND; #endif td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | - TDF_NEEDRESCHED | TDF_OWEUPC | TDF_INTERRUPT); + TDF_NEEDRESCHED | TDF_INTERRUPT); cnt.v_soft++; mtx_unlock_spin(&sched_lock); /* @@ -191,10 +191,10 @@ ast(struct trapframe *framep) if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (flags & TDF_OWEUPC && p->p_flag & P_PROFIL) { - addupc_task(td, p->p_stats->p_prof.pr_addr, - p->p_stats->p_prof.pr_ticks); - p->p_stats->p_prof.pr_ticks = 0; + if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) { + addupc_task(td, td->td_profil_addr, td->td_profil_ticks); + td->td_profil_ticks = 0; + td->td_pflags &= ~TDP_OWEUPC; } if (sflag & PS_ALRMPEND) { PROC_LOCK(p); -- cgit v1.1