-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix bug:getTopology will be failed on Arm platform #2114
Conversation
Hi @lubinszARM. Thanks for your PR. I'm waiting for a google or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@dashpole |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any testing for this change?
fdf02ed
to
1cc33d2
Compare
@dashpole |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more edge case
machine/machine.go
Outdated
|
||
num, err := ioutil.ReadFile(file) | ||
if err != nil { | ||
// report threadId if no NUMA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this failure always indicate there is no NUMA? Maybe only return threadId if the error is os.IsNotExist(err)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I have removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was suggesting
if os.IsNotExist(err) {
// report threadId if no NUMA
return threadId, nil
} else if err != nil {
return 0, err
}
I don't have enough context on the change to know if that is actually the right thing to do here, but whatever you think the correct behavior is works for me.
On Arm platform, no 'core id' and 'physical id' in '/proc/cpuinfo'. So we should search sysfs cpu path directly to get the data of 'thread_id' &'core_id' & 'node_id'. This method can also be used on other platforms, such as x86, ppc64le... /sys/bus/cpu/devices/cpu%d contains the information of 'core_id' & 'node_id'. Such as: cat /sys/bus/cpu/devices/cpu0/topology/core_id ls /sys/bus/cpu/devices/cpu0/node0 Signed-off-by: Bin Lu <bin.lu@arm.com>
/retest |
let me know about the |
@dashpole Another problem is that the kernel is starting to support numa from version 2.5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
On Arm platform, no 'core id' and 'physical id' in '/proc/cpuinfo'.
So we should search sysfs cpu path directly to get the data of
'thread_id' &'core_id' & 'node_id'.
This method can also be used on other platforms, such as x86, ppc64le...
/sys/bus/cpu/devices/cpu%d contains the information of 'core_id' & 'node_id'.
Such as:
cat /sys/bus/cpu/devices/cpu0/topology/core_id
ls /sys/bus/cpu/devices/cpu0/node0
Signed-off-by: Bin Lu bin.lu@arm.com