--- //depot/vendor/freebsd/src/sys/kern/kern_kse.c 2007/07/23 23:22:43 +++ //depot/user/attilio/attilio_schedlock/kern/kern_kse.c 2007/07/24 10:50:14 @@ -82,6 +82,23 @@ } 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) { --- //depot/vendor/freebsd/src/sys/kern/kern_thread.c 2007/07/23 14:58:56 +++ //depot/user/attilio/attilio_schedlock/kern/kern_thread.c 2007/07/24 08:26:20 @@ -299,6 +299,9 @@ td_first = td_next; } } +#ifdef KSE + upcall_reap(); +#endif } /* --- //depot/vendor/freebsd/src/sys/sys/proc.h 2007/07/23 14:58:56 +++ //depot/user/attilio/attilio_schedlock/sys/proc.h 2007/07/24 08:26:20 @@ -871,6 +871,7 @@ #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);