summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-03-13 19:15:43 +0000
committerpeter <peter@FreeBSD.org>2004-03-13 19:15:43 +0000
commit2e6210da31c2145ccf66ba0c624d974fe3a30772 (patch)
tree45ae216c518690f48b18a0ec50943c69c206e2c2
parentee5bb488e197a311a062a18ee0add61069b39d95 (diff)
downloadFreeBSD-src-2e6210da31c2145ccf66ba0c624d974fe3a30772.zip
FreeBSD-src-2e6210da31c2145ccf66ba0c624d974fe3a30772.tar.gz
Reduce the scope of the Giant lock being held for non-mpsafe syscalls.
There was way too much code being covered.
-rw-r--r--sys/amd64/amd64/trap.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 0a2c93b..53c3b5a 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -754,13 +754,6 @@ syscall(frame)
ktrsyscall(code, narg, argp);
#endif
- /*
- * Try to run the syscall without Giant if the syscall
- * is MP safe.
- */
- if ((callp->sy_narg & SYF_MPSAFE) == 0)
- mtx_lock(&Giant);
-
if (error == 0) {
td->td_retval[0] = 0;
td->td_retval[1] = frame.tf_rdx;
@@ -769,7 +762,12 @@ syscall(frame)
PTRACESTOP_SC(p, td, S_PT_SCE);
- error = (*callp->sy_call)(td, argp);
+ if ((callp->sy_narg & SYF_MPSAFE) == 0) {
+ mtx_lock(&Giant);
+ error = (*callp->sy_call)(td, argp);
+ mtx_unlock(&Giant);
+ } else
+ error = (*callp->sy_call)(td, argp);
}
switch (error) {
@@ -807,12 +805,6 @@ syscall(frame)
}
/*
- * Release Giant if we previously set it.
- */
- if ((callp->sy_narg & SYF_MPSAFE) == 0)
- mtx_unlock(&Giant);
-
- /*
* Traced syscall.
*/
if (orig_tf_rflags & PSL_T) {
OpenPOWER on IntegriCloud