Missing threads: AMD A9-9420e RADEON R5, 5 COMPUTE CORES 2C+3G (2) @ 2.70 GHz

I installed htop and noted that I am missing 6 threads of those that my cpu provides, notice that is confirmed my sysctl kern.sched.topology_spec with the output:
Code:
kern.sched.topology_spec: <groups>
 <group level="1" cache-level="2">
  <cpu count="2" mask="3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">0, 1</cpu>
 </group>
</groups>
 
I installed htop and noted that I am missing 6 threads of those that my cpu provides, notice that is confirmed my sysctl kern.sched.topology_spec with the output:
Code:
kern.sched.topology_spec: <groups>
 <group level="1" cache-level="2">
  <cpu count="2" mask="3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">0, 1</cpu>
 </group>
</groups>
Your CPU only has 2 cores and 2 threads:
 
  1. Even if i have not missing 6 threads of 8, I still would be missing 2 threads of 4 as reported by htop.
  2. I remember htop reported 8 threads in this exact same device under Linux.
Don't trust Open Source software reporting, especially for older hardware. And yours was released in 2016. Things have improved since, but I did have instances back then when Linux thought I have 8 cores when in fact I had just 4. And I've been with FreeBSD since 2017. FreeBSD's htop was not accurate back then, either.

Knowing the exact model of the processor really helps with finding correct hardware information on the Internet. 😩
 
notice that is confirmed my sysctl kern.sched.topology_spec with the output:
[...]
cpu count="2"[...]
I see 2 CPUs in the sysctl's output you quoted.

I also can confirm what astyle found on the internet, when I search for that CPU on the internet:
2 cores, 2 threads - if the CPU you named in the title is actually the one - don't always blindly trust datasheets/marketing brochures (especially on graphic cards), or your memory; I don't know about you, but you were not the only one with more than one machine, so mixing things up, while being so damn sure, may happen :cool:

To get what FreeBSD really sees you'd better use
dmesg | grep CPU
(see top-section of complete dmesg's output for complete information (features) of your CPU; can be telling if you e.g. get issues with virtual machines, hypervisors, or stuff.)

I just (temporarily) installed htop to test what I get on my machine.
Besides my htop only shows me my threads, not the cores, the count is correct (on my machine.)
To me htop seems to be just a more playful version of classic top; which I also use seldom anymore.
Since I switched to FreeBSD I learned there are better, more reliable ways to get precise information on what's really going on.
But that's my personal taste, of course.
 
Even if i have not missing 6 threads of 8, I still would be missing 2 threads of 4 as reported by htop.
Radeon naming. "5 COMPUTE CORES 2C+3G" means 2 cpu cores and 3 gpu cores.

As people say, utilities is not accurate whith some CPU, my AMD 3020e in Lenovo notebook have 2 cores and 14 "disabled cores", as show linux' nproc --all
 
Even if i have not missing 6 threads of 8, I still would be missing 2 threads of 4 as reported by htop.
Did you read "2 cores, 2 threads" as 2 threads per each of 2 cores (i.e. 2x2) ?
No, it's two threads in total.
Most people wouldn't even mention threads for a configuration like this, it's just 2 cores (no SMT).
 
Code:
CPU: AMD A9-9420e RADEON R5, 5 COMPUTE CORES 2C+3G   (1796.72-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0: <ACPI CPU> on acpi0
Yeah, threads are reported as separate CPUs, even though that's not correct... here's my snippet from my dmesg on my machine:
Code:
CPU: AMD Ryzen 7 5825U with Radeon Graphics          (1996.33-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs
cpu0: <ACPI CPU> on acpi0

Make and model detected correctly, but my processor only has 8 cores/16 threads...
 
So it shows, what you got.

I didn't ment this to be some competition, but okay:
Code:
CPU: AMD Ryzen 9 5900X 12-Core Processor             (4175.23-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs
...waiting for some Pro post some machine which put our 'homecomputers' a bit into perspective 😂
 
You have to do something like this:

Code:
 ╰─$ grep SMP /var/run/dmesg.boot
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 hardware threads

to see everything in detail.
 
You have to do something like this:

Code:
 ╰─$ grep SMP /var/run/dmesg.boot
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 hardware threads

to see everything in detail.
not bad, OP should run that, but CPUs are not exactly the correct term to use to report how many threads total a system has.

Also, how about `dmesg | grep SMP` ? same thing, less typing.
 
You have to do something like this:

Code:
 ╰─$ grep SMP /var/run/dmesg.boot
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 hardware threads

to see everything in detail.
Code:
grep SMP /var/run/dmesg.boot
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs                                                     FreeBSD/SMP: 1 package(s) x 2 core(s)
 
not bad, OP should run that, but CPUs are not exactly the correct term to use to report how many threads total a system has.

Also, how about `dmesg | grep SMP` ? same thing, less typing.
dmesg may not give the complete boot log if uptime is more than a few days and if you have a garbage BIOS that pukes errors every few seconds. The log file is always correct as it's written at the end of the boot process and never touched until the next reboot.
 
sysctl hw.ncpu

This shows how many compute pipelines or "threads" by todays, simplified language are actually available to the OS - regardless of number of physical CPUs, cores or threads per core (yes, there can be more than 2, e.g. 8, 16 or even 32 for various SPARC CPUs). This involves no guesswork by some (possibly wrong/outdated) hardware database...

e.g.
Code:
% sysctl hw.model hw.ncpu
hw.model: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
hw.ncpu: 8
this has 8 single-threaded cores.

Code:
# sysctl hw.model hw.ncpu
hw.model: Intel(R) Xeon(R) CPU E5-2660 v4 @ 2.00GHz
hw.ncpu: 56
this actually has 2 cpus with 14 cores x 2 threades/core

(and my T1000 currently has a dead PSU fan, but it would show 'hw.ncpu: 32', having 4 physical cores with 8 threads each)
 
sysctl hw.ncpu

This shows how many compute pipelines or "threads" by todays, simplified language are actually available to the OS - regardless of number of physical CPUs, cores or threads per core (yes, there can be more than 2, e.g. 8, 16 or even 32 for various SPARC CPUs). This involves no guesswork by some (possibly wrong/outdated) hardware database...

e.g.
Code:
% sysctl hw.model hw.ncpu
hw.model: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
hw.ncpu: 8
this has 8 single-threaded cores.

Code:
# sysctl hw.model hw.ncpu
hw.model: Intel(R) Xeon(R) CPU E5-2660 v4 @ 2.00GHz
hw.ncpu: 56
this actually has 2 cpus with 14 cores x 2 threades/core

(and my T1000 currently has a dead PSU fan, but it would show 'hw.ncpu: 32', having 4 physical cores with 8 threads each)
Code:
$ sysctl hw.model hw.ncpu
hw.model: AMD A9-9420e RADEON R5, 5 COMPUTE CORES 2C+3G
hw.ncpu: 2
 
but CPUs are not exactly the correct term to use to report how many threads total a system has.
You are right, of course.
But, well, from the OS perspective a hardware thread is a logical processing unit.
"CPU" is just a nickname for a processing unit since the times when there used to be only one processing unit per machine.
 
May require some permissions?
Something wrong with using root?

You gotta be root anyway to compile that port inside a jail. And you gotta be root to run some of that stuff anyway. You can mess around with suid bit to allow regular users to run it, but it's simpler to do it as root.

Besides, in a jail, hardware is plenty visible. RAM usage and filepaths can be restricted for a jail, though.
 
Something wrong with using root?

You gotta be root anyway to compile that port inside a jail. And you gotta be root to run some of that stuff anyway. You can mess around with suid bit to allow regular users to run it, but it's simpler to do it as root.

Besides, in a jail, hardware is plenty visible. RAM usage and filepaths can be restricted for a jail, though.
No wrong to use root. Just that I don't know if I would need to add allows to the jail, nor what permissions.
 
No wrong to use root. Just that I don't know if I would need to add allows to the jail, nor what permissions.
You want to be complicated with the security model, use Windows.

You gotta be root to compile ports or install packages, even the Handbook will tell you so.

You also gotta be root to configure hardware within FreeBSD, so that the .ko modules are loaded and can make use of your machine.

Yeah, you gotta be careful when doing stuff as root, true.
 
Back
Top