From owner-cvs-src@FreeBSD.ORG Wed Jan 11 13:56:48 2006 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F12C616A41F; Wed, 11 Jan 2006 13:56:47 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 499F543D46; Wed, 11 Jan 2006 13:56:44 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k0BDuh0B026430; Wed, 11 Jan 2006 06:56:43 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <43C50E9B.5050508@samsco.org> Date: Wed, 11 Jan 2006 06:56:43 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20051230 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200601110037.k0B0bDv4009424@repoman.freebsd.org> <200601110847.08614.jhb@freebsd.org> In-Reply-To: <200601110847.08614.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Scott Long , cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern subr_taskqueue.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2006 13:56:48 -0000 John Baldwin wrote: > On Tuesday 10 January 2006 07:37 pm, Scott Long wrote: > >>scottl 2006-01-11 00:37:13 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/kern subr_taskqueue.c >> Log: >> The interlock in taskqueue_terminate() is completely wrong for taskqueues >> that use spinlocks. Remove it for now. > > > Eh? It's waiting for the wakeup that comes from kthread_exit() after the > thread has exited which is locked via the proc lock. Sleeping on the > taskqueue itself doesn't buy you anything. (In fact, it might sleep > forever.) The simplest solution might be to acquire the proc lock a lot > earlier before the taskqueue lock in this function so that you don't have to > acquire it while holding the taskqueue lock since that is what gives you > problems. > With the code the way it was, kthread_exit() in taskqueue_thread_loop can wind up blocking on the proc lock while the lock is still held in taskqueue_terminate. I don't know why this is actually a problem, but turning on WITNESS to investigate revealed the immediate problem of trying to grab the proc lock with a spinlock already held. The interlock is really just a protection against drivers that don't adequately quiesce themselves, so I removed it for now until we can figure out something better. Scott