ferry-hhh / CXL-DMSim

CXL-DMSim: A Full-System CXL Disaggregated Memory Simulator Based on gem5
BSD 3-Clause "New" or "Revised" License
19 stars 3 forks source link

How to add CXL driver in Linux #2

Closed cunyangwei closed 1 month ago

cunyangwei commented 1 month ago

I notice that "We provide a Linux Kernel file with added drivers for CXL devices, version 5.4.49". However, this kernel seems like do not set NUMA config. I mean, when I use cat /proc/vmstat | grep numa, it does not output informations related to numa_pages_migrated, numa_hint_faults.

I use this to build linux kernel and make # CONFIG_NUMA to be setted. But when I use this kernel, system does not recognize the CXL.

Can you give me some advise about how to add drivers for CXL devices?

ferry-hhh commented 1 month ago

Sorry for the delayed response, I was on vacation last week.  Regarding your first question, I checked the config file and found that CONFIG_NUMA_BALANCING was not set. As a result, statistics like numa_pages_migrated and numa_hint_faults were missing. After enabling this option and running cat /proc/vmstat | grep numa again, I got the following output: 

numa_hit 98221  
numa_miss 0  
numa_foreign 0  
numa_interleave 34625  
numa_local 79561  
numa_other 18660  
numa_pte_updates 0  
numa_huge_pte_updates 0  
numa_hint_faults 0  
numa_hint_faults_local 0  
numa_pages_migrated 0

 I’ve uploaded the recompiled Linux kernel file as vmlinux_20240920.  As for your second question, it requires adding CXL device driver code to the Linux kernel and enabling NUMA-related configurations in the config file. More details will be available once our paper (currently under review) is published. Thank you for your understanding.