From owner-cvs-all@FreeBSD.ORG Sun Oct 14 18:48:27 2007 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0976F16A469 for ; Sun, 14 Oct 2007 18:48:27 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id C26CC13C46B for ; Sun, 14 Oct 2007 18:48:26 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 24227 invoked from network); 14 Oct 2007 18:48:27 -0000 Received: from ppp-71-139-1-224.dsl.snfc21.pacbell.net (HELO ?10.0.5.18?) (nate-mail@71.139.1.224) by root.org with ESMTPA; 14 Oct 2007 18:48:27 -0000 Message-ID: <47126474.9010108@root.org> Date: Sun, 14 Oct 2007 11:48:20 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Alexander Leidinger References: <20071014105947.D096C16A57E@hub.freebsd.org> In-Reply-To: <20071014105947.D096C16A57E@hub.freebsd.org> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: cvs-src@freebsd.org, src-committers@FreeBSD.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/share/man/man4 coretemp.4 src/sys/dev/coretemp coretemp.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2007 18:48:27 -0000 Alexander Leidinger wrote: > netchild 2007-10-14 10:59:44 UTC > > FreeBSD src repository > > Modified files: > share/man/man4 coretemp.4 > sys/dev/coretemp coretemp.c > Log: > Convert coretemp(4) to the hardware sensors framework and > make sure to never call sched_bind() for uninitialised CPUs. > > Submitted by: Constantine A. Murenin > Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors) > Mentored by: syrinx > Tested by: many > OKed by: kensmith > > Revision Changes Path > 1.2 +14 -6 src/share/man/man4/coretemp.4 > 1.3 +46 -35 src/sys/dev/coretemp/coretemp.c > - thread_lock(curthread); > - sched_unbind(curthread); > - thread_unlock(curthread); > + * Bind to specific CPU to read the correct temperature. > + * If not all CPUs are initialised, then only read from > + * cpu0, returning -1 on all other CPUs. > + */ > + if (smp_cpus > 1) { > + thread_lock(curthread); > + sched_bind(curthread, cpu); > + msr = rdmsr(MSR_THERM_STATUS); > + sched_unbind(curthread); > + thread_unlock(curthread); > + } else if (cpu != 0) > + return (-1); > + else > + msr = rdmsr(MSR_THERM_STATUS); I reviewed this part of the patch for Rui Paulo and told him to use smp_active instead of smp_cpus > 1. -- Nate