diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2007-07-27 09:21:18 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2007-07-27 09:21:18 +0000 |
| commit | 34ed04003047ce262ded400fc52f4c6d47564fd8 (patch) | |
| tree | 5ce631f90c03f140488b25b2b959bec880345b06 | |
| parent | 4eb78fa9a93bcda62908e252843e750f372f7b83 (diff) | |
Notes
| -rw-r--r-- | sys/kern/kern_kse.c | 17 | ||||
| -rw-r--r-- | sys/kern/kern_thread.c | 3 | ||||
| -rw-r--r-- | sys/sys/proc.h | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index a4a92e187ecd..acdb55d54dd3 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -82,6 +82,23 @@ upcall_alloc(void) } void +upcall_reap(void) +{ + TAILQ_HEAD(, kse_upcall) zupcalls; + struct kse_upcall *ku_item, *ku_tmp; + + TAILQ_INIT(&zupcalls); + mtx_lock_spin(&kse_lock); + if (!TAILQ_EMPTY(&zombie_upcalls)) { + TAILQ_CONCAT(&zupcalls, &zombie_upcalls, ku_link); + TAILQ_INIT(&zombie_upcalls); + } + mtx_unlock_spin(&kse_lock); + TAILQ_FOREACH_SAFE(ku_item, &zupcalls, ku_link, ku_tmp) + uma_zfree(upcall_zone, ku_item); +} + +void upcall_remove(struct thread *td) { diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index e06d18c53071..f12e724f9ae6 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -299,6 +299,9 @@ thread_reap(void) td_first = td_next; } } +#ifdef KSE + upcall_reap(); +#endif } /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index d7697f344a72..a0fd5336c3e7 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -871,6 +871,7 @@ void cpu_set_fork_handler(struct thread *, void (*)(void *), void *); #ifdef KSE void kse_unlink(struct thread *); void kseinit(void); +void upcall_reap(void); void upcall_remove(struct thread *td); #endif void cpu_set_upcall(struct thread *td, struct thread *td0); |
