From owner-freebsd-current@FreeBSD.ORG Mon Apr 4 21:10:23 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2253C10656AD for ; Mon, 4 Apr 2011 21:10:23 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id AC7148FC17 for ; Mon, 4 Apr 2011 21:10:22 +0000 (UTC) Received: by eyg7 with SMTP id 7so1954061eyg.13 for ; Mon, 04 Apr 2011 14:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Hw5ffds9CpRbyUMzMLY03BTWna0zs8PcNtq7D1PT0RM=; b=XzhC5yfP+9Cf18tIgasyr0DyyTXoGySZLwmpipgCfuEuKPEjygvi0/JQN0EXaDP9H1 AtF7KbY3UvbjgWCScT95T3BdckuRXrlNyxp1kCTBpqRxcLGWe+GF1q5/1uqNUKFdmTIm mUT76mGH5PCUKSOUSWhu8ec9aFGmuKlF0t+Yk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=jn4caVf4rHcze9RnVpiNnNNznemQazcz4pw3+ZWA8m+F+sQf/QsCL524rf1jd4LFUB gkNnzwf9VCilrxb3JXbOz68c8PjAkVFTIFYXqCp/jCHSPE/WnXOWrDUWt0yqgBtHAj/g QXT5CN65kVIqLkjvK7bZnSiY2qh3CPz4PzcjA= MIME-Version: 1.0 Received: by 10.213.105.204 with SMTP id u12mr3826786ebo.130.1301951420277; Mon, 04 Apr 2011 14:10:20 -0700 (PDT) Received: by 10.213.112.212 with HTTP; Mon, 4 Apr 2011 14:10:20 -0700 (PDT) Date: Mon, 4 Apr 2011 17:10:20 -0400 Message-ID: From: Ryan Stone To: FreeBSD Current Content-Type: text/plain; charset=ISO-8859-1 Subject: sched_4bsd startup crash trying to run a bound thread on an AP that hasn't started X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 04 Apr 2011 21:10:23 -0000 I'm running into a bootup crash under sched_4bsd on HEAD. The crash happens when I have a thread bound to a single CPU that isn't the BSP, and that thread is scheduled. If the AP that the thread is bound hasn't been started up, kick_other_cpu() crashes because pcpu->pc_curthread is NULL for the AP. I've put a small test kld in http://people.freebsd.org/~rstone/4bsd_bind/ that reproduces the problem. I'm not sure what the best way to address the crash is. ULE is not affected by the problem; it seems to run the swi thread on CPU 0 until CPU 1 is running. Here's a sample backtrace: Fatal trap 12: page fault while in kernel mode^M^M cpuid = 0; apic id = 00^M^M fault virtual address = 0x2fa^M^M fault code = supervisor read data, page not present^M^M instruction pointer = 0x20:0xffffffff803b473b^M^M stack pointer = 0x28:0xffffffff80a2c740^M^M frame pointer = 0x28:0xffffffff80a2c790^M^M code segment = base 0x0, limit 0xfffff, type 0x1b^M^M = DPL 0, pres 1, long 1, def32 0, gran 1^M^M processor eflags = resume, IOPL = 0^M^M current process = 0 (swapper)^M^M trap number = 12^M^M panic: page fault^M^M cpuid = 0^M^M KDB: stack backtrace:^M^M db_trace_self_wrapper() at 0xffffffff801cac8a = db_trace_self_wrapper+0x2a^M^M panic() at 0xffffffff8038ef92 = panic+0x182^M^M trap_fatal() at 0xffffffff8057d32d = trap_fatal+0x2ad^M^M trap() at 0xffffffff8057e01f = trap+0x29f^M^M calltrap() at 0xffffffff80561397 = calltrap+0x8^M^M --- trap 0xc, rip = 0xffffffff803b473b, rsp = 0xffffffff80a2c740, rbp = 0xfffffff f80a2c790 ---^M^M sched_add() at 0xffffffff803b473b = sched_add+0xeb^M^M intr_event_schedule_thread() at 0xffffffff803633e0 = intr_event_schedule_thread+0 xa0^M^M hardclock_device_poll() at 0xffffffff8037f9a5 = hardclock_device_poll+0x35^M^M hardclock() at 0xffffffff80342dd3 = hardclock+0x43^M^M lapic_handle_timer() at 0xffffffff80568033 = lapic_handle_timer+0xf3^M^M Xtimerint() at 0xffffffff80561ecc = Xtimerint+0x8c^M^M