kern/145385: [cpu] Logical processor cannot be disabled for some SMT-enabled Intel procs

Andriy Gapon avg at freebsd.org
Sat Sep 18 08:50:07 UTC 2010


The following reply was made to PR kern/145385; it has been noted by GNATS.

From: Andriy Gapon <avg at freebsd.org>
To: bug-followup at freebsd.org, gcooper at freebsd.org,
        Jeff Roberson <jroberson at jroberson.net>
Cc:  
Subject: Re: kern/145385: [cpu] Logical processor cannot be disabled for some
 SMT-enabled Intel procs
Date: Sat, 18 Sep 2010 11:48:39 +0300

 Regarding the part of the patch that sets logical_cpus - I don't really
 understand what logical_cpus represents.
 It seems that in topo_probe_0x4() it's set to maximum (possible) number of
 logical CPUs per whole package (for BSP package).  In topo_probe_0xb(), as
 you've spotted, it was not set at all.
 
 We already have cpu_logical variable (talk about confusing names) and that
 represents number of logical CPUs per core.
 
 So, I think that logical_cpus should be abolished altogether and cpu_logical
 should be used in its place.
 That would be the end of topo_probe_0x4() where hyperthreading_cpus is assigned
 with fallback value and init_secondary() where it's used to set logical_cpus_mask.
 
 P.S. The code also doesn't seem to properly handle a case where
 boot_cpu_id % logical_cpus != 0
 and/or
 boot_cpu_id % hyperthreading_cpus !=0
 Not sure if that ever happens in real systems, though.
 
 -- 
 Andriy Gapon


More information about the freebsd-bugs mailing list