From owner-freebsd-current@FreeBSD.ORG Thu Nov 23 16:58:58 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7909416A403; Thu, 23 Nov 2006 16:58:58 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (bitblocks.com [209.204.185.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F63D43D69; Thu, 23 Nov 2006 16:58:21 +0000 (GMT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 5931F5B3E; Thu, 23 Nov 2006 08:58:57 -0800 (PST) To: Hajimu UMEMOTO In-reply-to: Your message of "Thu, 23 Nov 2006 21:07:36 +0900." Date: Thu, 23 Nov 2006 08:58:57 -0800 From: Bakul Shah Message-Id: <20061123165857.5931F5B3E@mail.bitblocks.com> Cc: freebsd-current@freebsd.org Subject: Re: unkillable qemu: sleeping in devdrn state X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 23 Nov 2006 16:58:58 -0000 > bakul> With a fairly recent -current kernel qemu sleeps in "devdrn" > bakul> state and is unkillable. /proc doesn't have qemu's pid entry > bakul> but it does show up in a ps listing! This bug is not 100% > bakul> repeatable but close enough. AFAIK this problem appears only > bakul> when kqemu is used with qemu. > > Though I'm not using qemu, I met similar problem with portupgrade. > The portupgrade sleeps in "devdrm" state. > Don't you set kern.pts.enable to 1? It seems the problem doesn't > occur when kern.pts.enable=0. I tried that but the problem remained. The following "fixed" it but I don't trust it is the right fix. IMHO destroy_dev() needs to do dev_relthread() or we need to figure out why si_threadcount is > 0 and fix that so that we don't have to go fix all the drivers. --- kqemu-freebsd.c-old Thu Nov 19 08:36:25 2006 +++ kqemu-freebsd.c Mon Nov 20 01:05:56 2006 @@ -321,6 +321,7 @@ #if __FreeBSD_version >= 500000 dev->si_drv1 = NULL; TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent); + dev_relthread(dev); destroy_dev(dev); #endif free(ks, M_KQEMU);