diff options
author | attilio <attilio@FreeBSD.org> | 2009-11-03 16:46:52 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2009-11-03 16:46:52 +0000 |
commit | 1c940ef4f4e225185b488e5cf1498863dfbbcebb (patch) | |
tree | 33345f6b0c0607c9b4b3c28c1eb1f317c974a310 /sys/kern/kern_intr.c | |
parent | bd5fd681f2fbbc4a77b04b7586fcd7537c516ded (diff) | |
download | FreeBSD-src-1c940ef4f4e225185b488e5cf1498863dfbbcebb.zip FreeBSD-src-1c940ef4f4e225185b488e5cf1498863dfbbcebb.tar.gz |
Split P_NOLOAD into a per-thread flag (TDF_NOLOAD).
This improvements aims for avoiding further cache-misses in scheduler
specific functions which need to keep track of average thread running
time and further locking in places setting for this flag.
Reported by: jeff (originally), kris (currently)
Reviewed by: jhb
Tested by: Giuseppe Cocomazzi <sbudella at email dot it>
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r-- | sys/kern/kern_intr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index d22bfea..3554b9f 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -1061,6 +1061,7 @@ int swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, void *arg, int pri, enum intr_type flags, void **cookiep) { + struct thread *td; struct intr_event *ie; int error; @@ -1085,11 +1086,10 @@ swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, if (error) return (error); if (pri == SWI_CLOCK) { - struct proc *p; - p = ie->ie_thread->it_thread->td_proc; - PROC_LOCK(p); - p->p_flag |= P_NOLOAD; - PROC_UNLOCK(p); + td = ie->ie_thread->it_thread; + thread_lock(td); + td->td_flags |= TDF_NOLOAD; + thread_unlock(td); } return (0); } |