From owner-freebsd-scsi@FreeBSD.ORG Tue Dec 13 23:05:44 2011 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C7D9106567A for ; Tue, 13 Dec 2011 23:05:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id B12908FC12 for ; Tue, 13 Dec 2011 23:05:43 +0000 (UTC) Received: by eekc50 with SMTP id c50so237491eek.13 for ; Tue, 13 Dec 2011 15:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=VSLd5Q+f8M96AGFD7jb2eDFIgO9J3yZikY5YcpsSCJ8=; b=KVNeV0e3K2kD9l2AQ+AINR49le3JXkQyrnGv7TrHt6LX+70JtU/odSNutXs8CyjaOA gEHj8LdW0lT2KiET0+VMCqwpM2yfvK01sWPYTm7VFiRhev9kuB+ZZkbZKx69uuUUAqoC HLcGUAgYNYrcmFsoCrXvPsWVamuNGA/Lle8qE= Received: by 10.14.149.134 with SMTP id x6mr309891eej.126.1323816205346; Tue, 13 Dec 2011 14:43:25 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id 39sm2044352eei.1.2011.12.13.14.43.23 (version=SSLv3 cipher=OTHER); Tue, 13 Dec 2011 14:43:24 -0800 (PST) Sender: Alexander Motin Message-ID: <4EE7D50A.6080201@FreeBSD.org> Date: Wed, 14 Dec 2011 00:43:22 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Chuck Tuffli Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-scsi Subject: CAM locking question X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 23:05:44 -0000 Hi. > As an experiment, I added CAM_SIM_LOCK/CAM_SIM_UNLOCK around the > TAILQ_INSERT_TAIL() in xpt_done(), and what was a reliable hang after > a minute or two hasn't shown up in an hour. There is no assertion, but in all cases I remember xpt_done() called while holding SIM lock. Adding another CAM_SIM_LOCK/CAM_SIM_UNLOCK should cause lock recursion and panic, if kernel built with INVARIANTS. -- Alexander Motin