From 91407731e5528326cfe14b333d57ac443ac1c888 Mon Sep 17 00:00:00 2001 From: davidxu Date: Thu, 30 Oct 2003 02:55:43 +0000 Subject: 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. --- sys/i386/i386/trap.c | 3 +++ sys/kern/kern_sig.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'sys') 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); -- cgit v1.1