From owner-freebsd-current@FreeBSD.ORG Tue Dec 30 09:47:55 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AE95310 for ; Tue, 30 Dec 2014 09:47:55 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34CF7229F for ; Tue, 30 Dec 2014 09:47:55 +0000 (UTC) Received: from laptop015.home.selasky.org (31.89-11-148.nextgentel.com [89.11.148.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B81E31FE022; Tue, 30 Dec 2014 10:47:47 +0100 (CET) Message-ID: <54A274EF.2030903@selasky.org> Date: Tue, 30 Dec 2014 10:48:31 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Chris H , Warren Block Subject: Re: HEADS UP: Enabling vt(4) by default References: <544E7679.7070207@FreeBSD.org> <54590B3E.2070701@dumbbell.fr> , <20141105101951.48542120@ernst.home> , , , <545A96D1.9070600@selasky.org> <9c1df797dde6628b43661c0356d9103f@ultimatedns.net> <54A1B383.1040902@selasky.org> In-Reply-To: <54A1B383.1040902@selasky.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: =?windows-1252?Q?Jean-S=E9bastienP=E9dron?= , freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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: Tue, 30 Dec 2014 09:47:55 -0000 Hi, I just had a quick look at "vt_core.c" with regard to callouts. And have the following comments: 1) Make sure callout_reset(), callout_schedule() and callout_stop() is always called locked. When no lock is specified, that means Giant! 2) callout_drain() must have an unlocked sleeping context, else use callout_stop() with the mutex specified in callout_init_mtx() to get atomicity. For now adding MTX_RECURSE to "mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF | MTX_RECURSE)" solved my problem temporarily, because callout_drain() tried to get the vd_lock, which was already taken. --HPS