RE: [PATCH] EDAC: Expose node link in sysfs if CONFIG_NUMA

From: Luck, Tony
Date: Tue May 16 2023 - 13:25:57 EST


>> If we have '/sys/devices/system/node/node0/mc0', by comparing the number
>> of dimm and MemTotal in meminfo. It is easy to know that the dimm didn't
>> recognized whether it belonged to this NUMA node or not.
>
> mc != NUMA node.

Modern systems have multiple memory controllers per socket.
On an Icelake server I see:

$ cd /sys/devices/system/edac/mc
$ ls -l
total 0
drwxr-xr-x. 5 root root 0 May 16 10:13 mc0
drwxr-xr-x. 3 root root 0 May 16 10:13 mc1
drwxr-xr-x. 5 root root 0 May 16 10:13 mc2
drwxr-xr-x. 3 root root 0 May 16 10:13 mc3
drwxr-xr-x. 5 root root 0 May 16 10:13 mc4
drwxr-xr-x. 3 root root 0 May 16 10:13 mc5
drwxr-xr-x. 5 root root 0 May 16 10:13 mc6
drwxr-xr-x. 3 root root 0 May 16 10:13 mc7
drwxr-xr-x. 2 root root 0 May 16 10:13 power
lrwxrwxrwx. 1 root root 0 May 16 03:11 subsystem -> ../../../../bus/edac
-rw-r--r--. 1 root root 4096 May 16 03:11 uevent

But I can figure out the socket topology with:

$ grep . mc*/mc_name
mc0/mc_name:Intel_10nm Socket#0 IMC#0
mc1/mc_name:Intel_10nm Socket#0 IMC#1
mc2/mc_name:Intel_10nm Socket#0 IMC#2
mc3/mc_name:Intel_10nm Socket#0 IMC#3
mc4/mc_name:Intel_10nm Socket#1 IMC#0
mc5/mc_name:Intel_10nm Socket#1 IMC#1
mc6/mc_name:Intel_10nm Socket#1 IMC#2
mc7/mc_name:Intel_10nm Socket#1 IMC#3

I think this should help connect "mc*" to which node
they belong to.

-Tony