diff options
author | marcel <marcel@FreeBSD.org> | 2004-07-08 21:08:07 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2004-07-08 21:08:07 +0000 |
commit | acd87011239f21612790ec0ff26db6af4ecdb3cd (patch) | |
tree | bcddccb843652b714f11e607eb1f69348f19eeb6 /sys/ia64 | |
parent | 0a98d3720a600be37ca9551e9f98dd52e3b72669 (diff) | |
download | FreeBSD-src-acd87011239f21612790ec0ff26db6af4ecdb3cd.zip FreeBSD-src-acd87011239f21612790ec0ff26db6af4ecdb3cd.tar.gz |
MFamd64 (1.275):
Reduce the scope of the Giant lock being held for non-mpsafe syscalls.
There was way too much code being covered.
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/trap.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 5b00494..0145ed2 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -973,11 +973,6 @@ syscall(struct trapframe *tf) else callp = &p->p_sysent->sv_table[code]; - /* - * Try to run the syscall without Giant if the syscall is MP safe. - */ - if ((callp->sy_narg & SYF_MPSAFE) == 0) - mtx_lock(&Giant); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(code, (callp->sy_narg & SYF_ARGMASK), args); @@ -991,7 +986,15 @@ syscall(struct trapframe *tf) PTRACESTOP_SC(p, td, S_PT_SCE); - error = (*callp->sy_call)(td, args); + /* + * Grab Giant if the syscall is not flagged as MP safe. + */ + if ((callp->sy_narg & SYF_MPSAFE) == 0) { + mtx_lock(&Giant); + error = (*callp->sy_call)(td, args); + mtx_unlock(&Giant); + } else + error = (*callp->sy_call)(td, args); if (error != EJUSTRETURN) { /* @@ -1013,12 +1016,6 @@ syscall(struct trapframe *tf) } } - /* - * Release Giant if we had to get it. - */ - if ((callp->sy_narg & SYF_MPSAFE) == 0) - mtx_unlock(&Giant); - userret(td, tf, sticks); #ifdef KTRACE |