From owner-freebsd-stable@FreeBSD.ORG Mon Aug 25 13:49:30 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70A2F16A4BF for ; Mon, 25 Aug 2003 13:49:30 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 82CAA43FB1 for ; Mon, 25 Aug 2003 13:49:29 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 18359 invoked by uid 1000); 25 Aug 2003 20:49:30 -0000 Date: Mon, 25 Aug 2003 13:49:30 -0700 (PDT) From: Nate Lawson To: ken@kdm.org Message-ID: <20030825134756.P18344@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: stable@freebsd.org cc: current@freebsd.org Subject: scsi-da does not work with INVARIANTS (fwd) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2003 20:49:30 -0000 Ken is aware of the following problem. It is in both cd(4) and da(4) as well as stable and current. One possible approach would be to run {da,cd}register() from a task queue and not at interrupt time. -Nate ---------- Forwarded message ---------- Date: Mon, 25 Aug 2003 15:45:22 -0500 From: Aniruddha Bohra To: njl@freebsd.org Subject: scsi-da does not work with INVARIANTS [ Also posted to -stable ] Hello I tried compiling the 4-STABLE branch with INVARIANTS and INVARIANT_SUPPORT. I got a panic on boot - The problem is that daregister calls malloc with M_WAITOK in interrupt context and INVARIANTS panics the kernel. $FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.42.2.40 2003/08/24 03:26:38 ken Exp $ The problem is in the following lines : softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2, CTLFLAG_RD, 0, tmpstr); SYSCTL_ADD_NODE is a macro defined in sys/sysctl.h as : #define SYSCTL_ADD_NODE(ctx, parent,nbr,name,access,handler, descr)\ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|access,\ 0, 0, handler, "N", descr); And sysctl_add_oid is defined in kern/kern_sysctl.c and has the following : oidp = malloc(sizeof(struct sysctl_oid), M_SYSCTLOID, M_WAITOK); which has a WAITOK malloc. Unfortunately, I cannot get a trace till tomorrow. Right now the machine runs fine without INVARIANTS and INVARIANT_SUPPORT. Thanks Aniruddha