From owner-freebsd-stable@FreeBSD.ORG Tue Jul 7 01:18:11 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED5F1065670 for ; Tue, 7 Jul 2009 01:18:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8328FC15 for ; Tue, 7 Jul 2009 01:18:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fxm18 with SMTP id 18so3879520fxm.43 for ; Mon, 06 Jul 2009 18:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=5Lr2T5SRTmIJCnuq6sGdLRgflUqaR5l4Kbtl2MpcEZ4=; b=r2vXG+9c3N0L+N1SZEX8RaeShTF+wP3uApEwhft5ikKoy68JIwe8YT2+Gz832wJgaH UaZODnCKGE/cni/KxaW5r80SF8wdL7ixOTAB0F0DBw3odV0UDPHQc/2Ii8eOv0u3ffdY 9p9oXM/7SwvXnbAtWDrm9PTu07S5J3dhV50bM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=cXCZz1ck0hspZsNkFzMUn2RKacKlC2/U1eOYFzSyeGkCuA0wG7xlelWPgKgsdLq+iP iinlpTHcU3lBfUUNYSoiUpL2jtXn4jbxvVbRbZB/fBnTzfIMtZbL4Fy0ZDEy3idShd2V FCEP4XWkFQFFCOVbvjEsVeetZ0aXG9vtMI/r4= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.108.15 with SMTP id d15mr2391300fap.62.1246929490108; Mon, 06 Jul 2009 18:18:10 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Jul 2009 03:18:10 +0200 X-Google-Sender-Auth: 54c161573281bdaa Message-ID: <3bbf2fe10907061818v245abd0cgc3ca5073cb93aea4@mail.gmail.com> From: Attilio Rao To: Dan Naumov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: FreeBSD-STABLE Mailing List Subject: Re: 7.2-release/amd64: panic, spin lock held too long X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 01:18:11 -0000 2009/7/7 Dan Naumov : > I just got a panic following by a reboot a few seconds after running > "portsnap update", /var/log/messages shows the following: > > Jul 7 03:49:38 atom syslogd: kernel boot file is /boot/kernel/kernel > Jul 7 03:49:38 atom kernel: spin lock 0xffffffff80b3edc0 (sched lock > 1) held by 0xffffff00017d8370 (tid 100054) too long > Jul 7 03:49:38 atom kernel: panic: spin lock held too long That's a known bug, affecting -CURRENT as well. The cpustop IPI is handled though an NMI, which means it could interrupt a CPU in any moment, even while holding a spinlock, violating one well known FreeBSD rule. That means that the cpu can stop itself while the thread was holding the sched lock spinlock and not releasing it (there is no way, modulo highly hackish, to fix that). In the while hardclock() wants to schedule something else to run and got stuck on the thread lock. Ideal fix would involve not using a NMI for serving the cpustop while having a cheap way (not making the common path too hard) to tell hardclock() to avoid scheduling while cpustop is in flight. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein