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.
This commit is contained in:
David Xu 2003-10-30 02:55:43 +00:00
parent 40bb965382
commit 7eeaaf9b97
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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);