diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-02-10 14:59:16 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-02-10 14:59:16 +0000 |
commit | 0f4f135a5ba1cfc6ff15f8bfd4a96d0a9738d943 (patch) | |
tree | 098e21d85bff6607511d6d686f992f9607879413 /sys/kern | |
parent | 3b21aaa91bbf8d1e948481884de9e8b674dfa64b (diff) | |
download | FreeBSD-src-0f4f135a5ba1cfc6ff15f8bfd4a96d0a9738d943.zip FreeBSD-src-0f4f135a5ba1cfc6ff15f8bfd4a96d0a9738d943.tar.gz |
Test before modifying p_sflag to avoid unconditionally cache line
ping-pong on SMP.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_trap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 686f613..c6af66b 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -182,9 +182,11 @@ ast(struct trapframe *framep) mtx_lock_spin(&sched_lock); flags = td->td_flags; sflag = p->p_sflag; - p->p_sflag &= ~(PS_ALRMPEND | PS_PROFPEND | PS_XCPU); + if (p->p_sflag & (PS_ALRMPEND | PS_PROFPEND | PS_XCPU)) + p->p_sflag &= ~(PS_ALRMPEND | PS_PROFPEND | PS_XCPU); #ifdef MAC - p->p_sflag &= ~PS_MACPEND; + if (p->p_sflag & PS_MACPEND) + p->p_sflag &= ~PS_MACPEND; #endif td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | TDF_NEEDRESCHED | TDF_INTERRUPT); |