cvs commit: src/sys/kern kern_kse.c kern_thread.c src/sys/sys proc.h

Attilio Rao attilio at freebsd.org
Tue Jul 24 10:03:08 UTC 2007


2007/7/23, Jung-uk Kim <jkim at freebsd.org>:
>
> Probably it should be something like this?
>
> @@ -60,9 +60,6 @@
>  extern struct mtx kse_lock;
>
>
> -TAILQ_HEAD(, kse_upcall) zombie_upcalls =
> -       TAILQ_HEAD_INITIALIZER(zombie_upcalls);
> -
>  static int thread_update_usr_ticks(struct thread *td);
>  static void thread_alloc_spare(struct thread *td);
>  static struct thread *thread_schedule_upcall(struct thread *td, struct kse_upcall *ku);
> @@ -106,7 +103,7 @@
>                 td->td_upcall->ku_owner = NULL;
>                 TAILQ_REMOVE(&td->td_upcall->ku_proc->p_upcalls, td->td_upcall,
>                     ku_link);
> -               TAILQ_INSERT_HEAD(&zombie_upcalls, td->td_upcall, ku_link);
> +               upcall_free(td->td_upcall);
>                 mtx_unlock_spin(&kse_lock);
>                 td->td_upcall = NULL;
>         }

This patch is not going to work as you call upcall_free (which uses
uma_zfree()) with necessary a spinlock held (td_upcall is thread
spinlock protected). UMA has its own locking stuffs in it (as
sleepable locks) so this will create locks mismatches.
Even if you could avoid it with rearrangement (probailly) I'm going to
ripristinate the old way of cleaning up stuffs in thread_reap()
through an ad-hoc upcall_reap() function.


Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the cvs-src mailing list