From owner-freebsd-smp@FreeBSD.ORG Sun Nov 9 02:13:01 2003 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E27416A4CE for ; Sun, 9 Nov 2003 02:13:01 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B408E43FE9 for ; Sun, 9 Nov 2003 02:12:59 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id VAA00374 for ; Sun, 9 Nov 2003 21:12:57 +1100 Date: Sun, 9 Nov 2003 21:12:56 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: smp@freebsd.org Message-ID: <20031109204643.J2752@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: foot-shooting using wrong pcpu X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2003 10:13:01 -0000 Does anyone have any experience with the pcpu sometimes being for the wrong cpu on i386's? I have a local locking bug which seems to cause this. The usual symptoms are that curpmap is sometimes 0 in cpu_switch(), and cpu_switch() sometimes switches cpuN to run cpuM's idle thread for M != N (this sometimes appears to work for a few switches but eventually the stacks trash each other). Problems in cpu_switch() seem to be more symptoms than causes. I can't see how either the pcpu selector or the pcpu GDT entry could get trashed (aren't these almost constant after booting? All lgdt's are early, and %fs is always KPSEL in the kernel except in the TLB shootdown IPI with default (?) options). I mostly look at pcu data in SMPprvspace since %fs is hard to use and "show pcpu" doesn't show enough, and everything in SMPprvspace seems reasonable except curpmap is sometimes 0. Bruce