node-feature-discovery
node-feature-discovery copied to clipboard
cpu: ignore unknown cpuid flags on non-x86
Avoid trying to create empty "cpu-cpuid." labels for cpuid flags that we don't have a description for.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: marquiz
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [marquiz]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Deploy Preview for kubernetes-sigs-nfd ready!
| Name | Link |
|---|---|
| Latest commit | 98fd07b1171e6cf68a629a507422c3a235fb6261 |
| Latest deploy log | https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/634d62321e6c520008fa6b83 |
| Deploy Preview | https://deploy-preview-914--kubernetes-sigs-nfd.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Not verified /hold
ping @Chandan-Abhyankar @yselkowitz
- this should be done for all architectures' code with manually curated lists (arm64, ppc64le, and s390x)
- let's also update the cpu flags for POWER 9 and 10, z14/15/16, and ARM v8.latest.
this should be done for all architectures' code with manually curated lists (arm64, ppc64le, and s390x)
- let's also update the cpu flags for POWER 9 and 10, z14/15/16, and ARM v8.latest.
I think the defensive fix proposed by @marquiz 'future' proofs the code against changes. I do like the referenced PR from Yaakov. It's a great catch/help. Chandan and I can try this out on a p10.
/retitle cpu: ignore unknown cpuid flags on non-x86
- this should be done for all architectures' code with manually curated lists (arm64, ppc64le, and s390x)
Ach, good point @yselkowitz. I updated the PR to handle other non-x86 architectures.
PTAL @Chandan-Abhyankar @yselkowitz @prb112
Thank you @marquiz , i don't have time to test it on s390x right now and i will be away next week. However the changes look good to me. Since they are the same for all arches, i'm fine with it if they work on the other arches.
One question unrelated to this PR: When i reviewed the loop, where does the capacity from the string array come from?
r := make([]string, 0, 20)
hwcap := uint64(C.gethwcap())
for i := uint(0); i < 64; i++ {
I mean we have 23 Flags defined for s390x and we check 64 bits. Is there a reason the array only has a cap of 20?
Thanks @jschintag, I'll then be happy with an ack from the arm and ppc guys 😊
One question unrelated to this PR: When i reviewed the loop, where does the capacity from the string array come from?
r := make([]string, 0, 20) hwcap := uint64(C.gethwcap()) for i := uint(0); i < 64; i++ {I mean we have 23 Flags defined for s390x and we check 64 bits. Is there a reason the array only has a cap of 20?
Good question, I'm not the original author of this code. I think it's just a (harmless) leftover from some eariler development stage. The slice capacity will get increased if more than 20 flags are present. This could be fixed in a separate PR though, I think (e.g. set cap to len(flagNames_s390x) or something more meaningful).
@marquiz This works on ppc64le. Chandan has tried it out and would resolve https://github.com/kubernetes-sigs/node-feature-discovery/issues/913
Any arm64 confirmation? @zvonkok @ArangoGutierrez ?
Rebased after #919 was merged /unhold
Verified that images build and unit tests pass on arm64 and s390x
/lgtm
@yselkowitz: changing LGTM is restricted to collaborators
In response to this:
/lgtm
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.
/lgtm
ping @fmuyassarov @zvonkok
/lgtm
/lgtm