-
Notifications
You must be signed in to change notification settings - Fork 355
Incorrect cache-info output with nosmt linux kernel command line #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please find attached the output of cache-info with and without the nosmt option, when cpuinfo is built with debug log level. |
Looking at the x86 logic (I'm horribly unfamiliar with it, so bear with me here :)), it looks like we'd only accidentally generate N caches if we assigned them each different L1I IDs. Digging through the code paths here, I don't see anywhere we would accidentally mark the same ID as different IDs, so that leads me to believe that our l1i_id calculation fails somehow.
I'd hazard a guess that this means either:
|
I just ran into the same issue: AMD EPYC 9334 with SMT :
So NNPACK reads a size of 32KB L1D shared by 65(???) threads That off-by-one seems to stem from it counting by apic_id and the 64 physical cores shared the same apic_id (zero) with the first "virtual" core (processor index 64) |
@jbd would you be able to test my PR for this: #291
There is already code to set a flag if and only if the APIC ID was determined for a processor. When SMT is disabled the hyperthreads (e.g. half the processors) don't have an APIC ID (defaults to zero) and hence don't have the flag. So the calculation of the L1I/D_id using a default APIC ID doesn't make much sense to me. This leads to the strange off-by-one error as the defaulted processors share the ID zero with the single "correct" one. |
Hello,
I'm using the main branch of today (3c8b153) and I've got incorrect output in cache-info on a machine booted with the "nosmt" kernel command line parameter:
WITH the "nosmt" parameter (note the weird "shared by XX processors" at the end of each line):
WITHOUT the "nosmt" parameter:
lscpu output WITH the "nosmt" parameter:
lscpu output WITHOUT the "nosmt" parameter:
The difference is are on the On-line/Off-line CPU(s) lists.
It caught me by surprise with a SIGFPE when using the NNPACK project (Maratyszcza/NNPACK#218).
Thank you for your help.
The text was updated successfully, but these errors were encountered: