From owner-freebsd-arch@FreeBSD.ORG Mon Sep 5 11:26:07 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C17AF106566B for ; Mon, 5 Sep 2011 11:26:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 18E3E8FC1F for ; Mon, 5 Sep 2011 11:26:06 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA29236 for ; Mon, 05 Sep 2011 14:26:05 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E64B1CC.9070205@FreeBSD.org> Date: Mon, 05 Sep 2011 14:26:04 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-arch@FreeBSD.org X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: SCHEDULER_STOPPED vs kdb_active X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 11:26:07 -0000 My simple question is whether kdb_active should be included as another indicator into SCHEDULER_STOPPED? I assume that kdb_active == true is visible only to the debugger code and never to the debugged code. I understand that there is some code that can be executed in both roles, but I am specifically asking about the roles, not the physical code. So, is this true? Assuming that the above is true, it doesn't make sense to not by-pass locking if the debugger infrastructure executes some common code. For example I don't understand why the kdb_active checks in kern_mutex.c are what they are. I think that kdb_active means that the currently running code is the only code that can make forward progress in the system. If we stumble upon a locked spinlock, then it doesn't make any sense to spin on it waiting for Godot. Similarly, I think that mtx_asser() should be a NOP if kdb_active. What important things/scenarios do I overlook? -- Andriy Gapon