kern/145385: [cpu] Logical processor cannot be disabled for some
SMT-enabled Intel procs
jroberson at jroberson.net
Tue Aug 24 21:10:10 UTC 2010
The following reply was made to PR kern/145385; it has been noted by GNATS.
From: Jeff Roberson <jroberson at jroberson.net>
To: Garrett Cooper <gcooper at FreeBSD.org>
Cc: bug-followup at freebsd.org, jkim at freebsd.org,
Attilio Rao <attilio at freebsd.org>, jeff at freebsd.org
Subject: Re: kern/145385: [cpu] Logical processor cannot be disabled for some
SMT-enabled Intel procs
Date: Tue, 24 Aug 2010 11:03:40 -1000 (HST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
On Tue, 24 Aug 2010, Garrett Cooper wrote:
> On Tue, Aug 24, 2010 at 12:22 PM, Jeff Roberson <jroberson at jroberson.net> wrote:
>> On Tue, 24 Aug 2010, Garrett Cooper wrote:
>>> On Mon, Aug 23, 2010 at 6:33 AM, John Baldwin <jhb at freebsd.org> wrote:
>>>> On Sunday, August 22, 2010 4:17:37 am Garrett Cooper wrote:
>>>>> The following trivial patch fixes the issue on my W3520 processor;
>>>> it's what should be done after reading several of the specs because the
>>>> logical count that's tracked with ebx is exactly what is needed for
>>>> logical_cpus (it's an absolute quantity). I need to verify it with a
>>>> topology at work (the two r710s I was testing with E-series Xeons on
>>>> available remotely right now).
>>>> Jung-uk Kim and Attilio Rao have both been looking at this code recently
>>>> are in a better position to review the patch in the PR.
>>> (Moving jhb@ to BCC, adding jeff@ for possible input on ULE)
>>> The patch works as expected (it now properly detects the SMIT CPUs as
>>> logical CPUs), but setting machdep.hlt_logical_cpus=1 causes other
>>> problems with scheduling tasks because certain kernel threads get
>>> stuck at boot when netbooting (in particular I've seen problems with
>>> usbhub* and a few others bits), so in order for
>>> machdep.hlt_logical_cpus to be fixed on SMT processors, it might
>>> require some changes to the ULE scheduler to shuffle around the
>>> threads to available cores/processors?
>> hlt_logical_cpus should be rewritten to use cpusets to change the default
>> system set rather than specifically halting those cpus. There are a number
>> of loops in the kernel that iterate over all cpus and attempt to bind and
>> perform some task. I think there are a number of other reasons to prefer a
>> less aggressive approach to avoiding the logical cpus as well. Simply
>> preventing user thread schedule will achieve the intent of the sysctl in any
> Ok... in that event then the bug is ok, but maybe I should add
> some code to the patch to warn the user about functional issues
> associated with halting logical CPUs?
I don't think the bug is ok. We probably shouldn't have sysctls which
readily break the kernel. As I said we should instead have the sysctl
backend to cpuset. It shouldn't take more than an hour to code and test.
More information about the freebsd-bugs