Hi, While creating multiple VMs with --vcpus cpuset=auto, which uses numad to retrieve cpu preplacement advice, I encountered the following error in dmesg that causes VM creation to hang:
[ 2624.656999] traps: numad[8403] trap divide error ip:58868d38ed06 sp:79b8d13fe7d0 error:0 in numad[58868d389000+c000]
I tracked it down to line 1403 in numad.c, where there's an attempt to divide by 0 (time_diff=0). time_diff is calculated by the difference in timestamps between the two cpu data buffers a few lines before. So when they're equal to each other this divide-by-zero error happens.
I inserted prints and found that the real timestamp values for the two cpu data buffers aren't actually equal before being returned by get_time_stamp(); it's just that the timestamp resolution (hundredths of a second) doesn't translate the actual timestamp difference that's on the order of less than 0.01 seconds. It looks like at line 1403 it's trying to determine the available CPU capacity by dividing CPU idle ticks by the timestamp difference.
Is there an intention behind specifically using 1/100 seconds as the smallest unit for this calculation?
Thanks, Nathan
Just opened https://pagure.io/numad/issue/12, apparent same issue