Date: Tue, 24 Jul 2007 12:04:41 +0200 From: "Attilio Rao" <attilio@freebsd.org> To: "Jung-uk Kim" <jkim@freebsd.org> Cc: Marcus Alves Grando <mnag@freebsd.org>, cvs-src@freebsd.org, Doug Barton <dougb@freebsd.org>, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_kse.c kern_thread.c src/sys/sys proc.h Message-ID: <3bbf2fe10707240304l76066c6sede74f72115988d7@mail.gmail.com> In-Reply-To: <3bbf2fe10707240303k584be666n5d721ca099c1e490@mail.gmail.com> References: <200707231452.l6NEqMot074554@repoman.freebsd.org> <46A4F893.20609@FreeBSD.org> <46A515B9.6060608@FreeBSD.org> <200707231750.34776.jkim@FreeBSD.org> <3bbf2fe10707240303k584be666n5d721ca099c1e490@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
2007/7/24, Attilio Rao <attilio@freebsd.org>: > 2007/7/23, Jung-uk Kim <jkim@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. Just for records: it seems that the upcall freeing removal has happened after revision 1.238 (so just after the splitting up of the KSE parts from the rest of the kernel). It is so a long-standing bug, it seems. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10707240304l76066c6sede74f72115988d7>