diff options
author | jeff <jeff@FreeBSD.org> | 2009-03-15 06:41:47 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2009-03-15 06:41:47 +0000 |
commit | ee1ec823f64df1e1cbfad16666bceeb4419bfa25 (patch) | |
tree | d61628888fc3c8f39efa8355161b1f2c39147b98 /sys/kern/kern_thread.c | |
parent | 17991531066544951ce0655b304c427f2688f64a (diff) | |
download | FreeBSD-src-ee1ec823f64df1e1cbfad16666bceeb4419bfa25.zip FreeBSD-src-ee1ec823f64df1e1cbfad16666bceeb4419bfa25.tar.gz |
- Implement a new mechanism for resetting lock profiling. We now
guarantee that all cpus have acknowledged the cleared enable int by
scheduling the resetting thread on each cpu in succession. Since all
lock profiling happens within a critical section this guarantees that
all cpus have left lock profiling before we clear the datastructures.
- Assert that the per-thread queue of locks lock profiling is aware of
is clear on thread exit. There were several cases where this was not
true that slows lock profiling and leaks information.
- Remove all objects from all lists before clearing any per-cpu
information in reset. Lock profiling objects can migrate between
per-cpu caches and previously these migrated objects could be zero'd
before they'd been removed
Discussed with: attilio
Sponsored by: Nokia
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r-- | sys/kern/kern_thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 4606005..bb8779b 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -306,6 +306,8 @@ thread_alloc(void) void thread_free(struct thread *td) { + + lock_profile_thread_exit(td); if (td->td_cpuset) cpuset_rel(td->td_cpuset); td->td_cpuset = NULL; @@ -439,6 +441,7 @@ thread_wait(struct proc *p) /* Wait for any remaining threads to exit cpu_throw(). */ while (p->p_exitthreads) sched_relinquish(curthread); + lock_profile_thread_exit(td); cpuset_rel(td->td_cpuset); td->td_cpuset = NULL; cpu_thread_clean(td); |