Date: Mon, 13 Feb 2006 18:20:09 GMT From: John Baldwin <jhb@freebsd.org> To: freebsd-threads@FreeBSD.org Subject: Re: threads/89262: [kernel] [patch] multi-threaded process hangs in kernel in fork() Message-ID: <200602131820.k1DIK9Yn005152@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR threads/89262; it has been noted by GNATS. From: John Baldwin <jhb@freebsd.org> To: David Xu <davidxu@freebsd.org> Cc: bug-followup@freebsd.org, garry@networkphysics.com Subject: Re: threads/89262: [kernel] [patch] multi-threaded process hangs in kernel in fork() Date: Mon, 13 Feb 2006 13:02:42 -0500 On Monday 13 February 2006 04:11, David Xu wrote: > ast will call userret which in turn will call thread_suspend_check. > so the bug may not be here, but in other code. > > I have found a race between sleep queue and thread suspension code, > the following patch fixed the bug, it also simplified interaction > between sleep queue and signal code. now, sleepq_abort() is also > fixed, it can save an errno, unlike current code, it wrongly works > as wakeup(). > > http://people.freebsd.org/~davidxu/patch/slpq_susp4.patch > > David Xu Only thing I would prefer is that you keep sleepq_catch_signals() but make it an internal function that sleepq_waitsig() and sleepq_timed_waitsig() call before sleepq_switch() so that sleepq_switch() doesn't get so long. Also, it would be good. Also, in sleepq_switch() you are using sleepq_release() and sleepq_lock() even though you already have a sleepqueue_chain pointer, and you do mtx operations on sc->sc_lock explicitly in some other places. It would be best to consistently just do mutex ops on sc->sc_lock instead of redoing the hash-lookup several times. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602131820.k1DIK9Yn005152>