From owner-freebsd-current@FreeBSD.ORG Mon May 5 14:25:04 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8988537B401 for ; Mon, 5 May 2003 14:25:04 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EA1843FBF for ; Mon, 5 May 2003 14:25:03 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 18167 invoked from network); 5 May 2003 21:25:11 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 5 May 2003 21:25:11 -0000 Received: from laptop.baldwin.cx ([216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h45LP0dt015595; Mon, 5 May 2003 17:25:00 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <02ed01c31347$56f023d0$932a40c1@PHE> Date: Mon, 05 May 2003 17:25:07 -0400 (EDT) From: John Baldwin To: Petri Helenius cc: freebsd-current@FreeBSD.org cc: sos@FreeBSD.org Subject: Re: kthread_exit and giant X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2003 21:25:04 -0000 On 05-May-2003 Petri Helenius wrote: >> >> The kthread is supposed to acquire Giant before calling kthread_exit(). >> Actually, my guess is that the ar kthread needs to acquire Giant for the >> lifetime of the thread. I have an untested patch locally: >> > I thought the lifetime of the thread is the duration of the rebuild process? Which > can be minutes to hours. Locking giant for that kind of time does not sound > right, so locking it just before thread exit sounds like the right thing to do, > as long as the code othervise keeps critical sections locked. Giant is dropped when a thread sleeps. It is designed to protect code that is not fully locked yet. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/