diff options
author | jhb <jhb@FreeBSD.org> | 2001-03-07 03:53:39 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-03-07 03:53:39 +0000 |
commit | 9c1fb038d7d49d0f13914c9cf74abbaf2252f87c (patch) | |
tree | ea5c5756813dfc5f6d0f22d45ad1cfb40be1cc74 /sys/ia64 | |
parent | f75a181b19d1c3a7bc52017f779a09ea9c8cecb0 (diff) | |
download | FreeBSD-src-9c1fb038d7d49d0f13914c9cf74abbaf2252f87c.zip FreeBSD-src-9c1fb038d7d49d0f13914c9cf74abbaf2252f87c.tar.gz |
- Release Giant a bit earlier on syscall exit.
- Don't try to grab Giant before postsig() in userret() as it is no longer
needed.
- Don't grab Giant before psignal() in ast() but get the proc lock instead.
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/trap.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 1858ded..8486877 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -85,11 +85,9 @@ userret(register struct proc *p, struct trapframe *frame, u_quad_t oticks) int sig; /* take pending signals */ - while ((sig = CURSIG(p)) != 0) { - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); + while ((sig = CURSIG(p)) != 0) postsig(sig); - } + mtx_lock_spin(&sched_lock); p->p_pri.pri_level = p->p_pri.pri_user; if (resched_wanted()) { @@ -107,11 +105,8 @@ userret(register struct proc *p, struct trapframe *frame, u_quad_t oticks) mi_switch(); mtx_unlock_spin(&sched_lock); PICKUP_GIANT(); - while ((sig = CURSIG(p)) != 0) { - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); + while ((sig = CURSIG(p)) != 0) postsig(sig); - } mtx_lock_spin(&sched_lock); } @@ -604,6 +599,7 @@ syscall(int code, u_int64_t *args, struct trapframe *framep) if (KTRPOINT(p, KTR_SYSRET)) ktrsysret(p->p_tracep, code, error, p->p_retval[0]); #endif + mtx_unlock(&Giant); /* * This works because errno is findable through the @@ -611,7 +607,6 @@ syscall(int code, u_int64_t *args, struct trapframe *framep) * is not the case, this code will need to be revisited. */ STOPEVENT(p, S_SCX, code); - mtx_unlock(&Giant); #ifdef WITNESS if (witness_list(p)) { @@ -665,17 +660,17 @@ ast(framep) if (p->p_sflag & PS_ALRMPEND) { p->p_sflag &= ~PS_ALRMPEND; mtx_unlock_spin(&sched_lock); - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); + PROC_LOCK(p); psignal(p, SIGVTALRM); + PROC_UNLOCK(p); mtx_lock_spin(&sched_lock); } if (p->p_sflag & PS_PROFPEND) { p->p_sflag &= ~PS_PROFPEND; mtx_unlock_spin(&sched_lock); - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); + PROC_LOCK(p); psignal(p, SIGPROF); + PROC_UNLOCK(p); } else mtx_unlock_spin(&sched_lock); |