Date: Sun, 14 Oct 2007 11:48:20 -0700 From: Nate Lawson <nate@root.org> To: Alexander Leidinger <netchild@FreeBSD.org> 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 Message-ID: <47126474.9010108@root.org> In-Reply-To: <20071014105947.D096C16A57E@hub.freebsd.org> References: <20071014105947.D096C16A57E@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <cnst@FreeBSD.org>
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47126474.9010108>
