diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-10-30 02:55:43 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-10-30 02:55:43 +0000 |
commit | 91407731e5528326cfe14b333d57ac443ac1c888 (patch) | |
tree | d0acaa16fc6bbe8f66bc85029a54e393fd6c3e21 /sys | |
parent | 8e63ac0e3853c02aaeafb63a881bbe069927f6a5 (diff) | |
download | FreeBSD-src-91407731e5528326cfe14b333d57ac443ac1c888.zip FreeBSD-src-91407731e5528326cfe14b333d57ac443ac1c888.tar.gz |
Try to fetch thread mailbox address in page fault trap, so when thread
blocks in page fault hanlder, and upcall thread can be scheduled. It is
useful if process is doing lots of mmap based I/O.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/i386/trap.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index f5fe14f..7f45106 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -315,6 +315,9 @@ trap(frame) break; case T_PAGEFLT: /* page fault */ + if (td->td_flags & TDF_SA) + thread_user_enter(p, td); + i = trap_pfault(&frame, TRUE, eva); #if defined(I586_CPU) && !defined(NO_F00F_HACK) if (i == -2) { diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ab98bb0..26ad4b1 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1498,7 +1498,8 @@ trapsignal(struct thread *td, int sig, u_long code) p = td->td_proc; if (td->td_flags & TDF_SA) { - thread_user_enter(p, td); + if (td->td_mailbox == NULL) + thread_user_enter(p, td); PROC_LOCK(p); if (td->td_mailbox) { SIGDELSET(td->td_sigmask, sig); |