From d0df115aaaa199c5e42d0a72332c770a6376774a Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 23 Sep 2004 21:03:58 +0000 Subject: Don't try to protect td_sticks with sched_lock. It doesn't need it as it is only accessed by curthread. --- sys/kern/subr_trap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sys/kern/subr_trap.c') diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 55b23c9..7753823 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -123,9 +123,7 @@ userret(td, frame, oticks) if (p->p_flag & P_PROFIL) { quad_t ticks; - mtx_lock_spin(&sched_lock); ticks = td->td_sticks - oticks; - mtx_unlock_spin(&sched_lock); addupc_task(td, TRAPF_PC(frame), (u_int)ticks * psratio); } } @@ -161,6 +159,7 @@ ast(struct trapframe *framep) mtx_assert(&Giant, MA_NOTOWNED); mtx_assert(&sched_lock, MA_NOTOWNED); td->td_frame = framep; + sticks = td->td_sticks; if ((p->p_flag & P_SA) && (td->td_mailbox == NULL)) thread_user_enter(td); @@ -173,7 +172,6 @@ ast(struct trapframe *framep) * ast() will be called again. */ mtx_lock_spin(&sched_lock); - sticks = td->td_sticks; flags = td->td_flags; sflag = p->p_sflag; p->p_sflag &= ~(PS_ALRMPEND | PS_PROFPEND | PS_XCPU); -- cgit v1.1