From owner-freebsd-stable@FreeBSD.ORG Mon Jun 15 12:23:50 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 11A6C106566C for ; Mon, 15 Jun 2009 12:23:50 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by mx1.freebsd.org (Postfix) with ESMTP id 8EAB08FC0A for ; Mon, 15 Jun 2009 12:23:49 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by bwz28 with SMTP id 28so555228bwz.43 for ; Mon, 15 Jun 2009 05:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/xkHn2tPm96OzP0FCmMH4cwtfSszu9xkTk68cFQumYM=; b=TXatXecOikWUtEeQtvRFbk3ngiSEUs5WdR2EjOB0G/JX4dyu06ES1+PkhD+7yE4DHc gM6zRqIKKaF+D0ijcqxS4Mt6amUAv0fsAzSP3Xey583XdWSMhhXRczsrzWtSRliXejCN +Ig5+xqmlPm2bYUV0xnJXksU+oUyqon+TNs/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=XNVxrPiFN9bTFJDa1ZxEgp4iFsL7kch6w0JNc1Fm0MoimMqZw+3er/MDXNcKQLznTG 74wDYJ6AQRGTP850ADhhyjh/3UYrt58ZL9mW8Sv81NF3Ed7ejEH0/VHJS0PiEUq6ygng QO4zEx/buTdtrLIXSRTFPXHuxZEis8n9/eDqU= MIME-Version: 1.0 Received: by 10.103.172.7 with SMTP id z7mr3595037muo.129.1245068628383; Mon, 15 Jun 2009 05:23:48 -0700 (PDT) In-Reply-To: References: Date: Mon, 15 Jun 2009 16:23:48 +0400 Message-ID: From: pluknet To: freebsd-stable Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: coretemp(4) lockups on 6-stable 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: Mon, 15 Jun 2009 12:23:50 -0000 2009/6/15 pluknet : > This is 6.4-stable from April. > > System locks up while in `sysctl dev.cpu` (with coretemp kldloaded). Small follow-up: Just one of my wild guesses is that coretemp doesn't play nice with ncpu > = 4. A problem box is 8-way cpu. I always observe this lockup when sched_bind(curthread, cpu) called with cpu=3D=3D4. While on another box `sysctl dev.cpu` works good and that box have only 4 cpu cores. > > So as far as I understand sched_bind() binds an executing thread to > nonexistent CPU 255. > Same behavior on coretemp built on 6.2. > > db> ps > =A0pid =A0ppid =A0pgrp =A0 uid =A0 state =A0 wmesg =A0 =A0 wchan =A0 =A0c= md > 34381 34380 34381 =A0 =A0 0 =A0R+ =A0 =A0 =A0CPU 255 =A0 =A0 =A0 =A0 =A0 = =A0 sysctl > [...] > db> bt 34381 > Tracing pid 34381 tid 100166 td 0xc8634680 > sched_switch(c8634680,0,1) at sched_switch+0x143 > mi_switch(1,0,c86347e0,4,c0a4e510,...) at mi_switch+0x1ba > sched_bind(c8634680,4,c856f3b0,0,c0836b3b,...) at sched_bind+0x52 > coretemp_get_temp_sysctl(c8ef56c0,c908c200,0,eebebc04,c8ef56c0,...) at > coretemp_get_temp_sysctl+0x47 > sysctl_root(0,eebebc74,4,eebebc04) at sysctl_root+0x107 > userland_sysctl(c8634680,eebebc74,4,0,bfbfda8c,0,0,0,eebebc70,0) at > userland_sysctl+0x112 > __sysctl(c8634680,eebebd04) at __sysctl+0x93 > syscall(3b,3b,3b,4,bfbfda8c,...) at syscall+0x2bf > Xint0x80_syscall() at Xint0x80_syscall+0x1f > --- syscall (202, FreeBSD ELF32, __sysctl), eip =3D 0x2812407b, esp =3D > 0xbfbfd9fc, ebp =3D 0xbfbfda38 --- > > static int > coretemp_get_temp(device_t dev) > { > =A0 =A0 =A0 =A0uint64_t msr; > =A0 =A0 =A0 =A0int temp; > =A0 =A0 =A0 =A0int cpu =3D device_get_unit(dev); > =A0 =A0 =A0 =A0struct coretemp_softc *sc =3D device_get_softc(dev); > =A0 =A0 =A0 =A0char stemp[16]; > > =A0 =A0 =A0 =A0mtx_lock_spin(&sched_lock); > =A0 =A0 =A0 =A0sched_bind(curthread, cpu); > =A0 =A0 =A0 =A0 ^^^ > =A0 =A0 =A0 =A0mtx_unlock_spin(&sched_lock); > > > -- > wbr, > pluknet > --=20 wbr, pluknet