Skip to content
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

feat: add cpu socket count in cpu.topology #1497

Merged

Conversation

AhmedGrati
Copy link

Resolves #1383

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 8, 2023
Copy link

netlify bot commented Dec 8, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit ebb0836
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/657c24c5440afa000704985b
😎 Deploy Preview https://deploy-preview-1497--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AhmedGrati AhmedGrati changed the title feat: add cpu socket number in cpu.topology feat: add cpu socket count in cpu.topology Dec 8, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 8, 2023
@AhmedGrati
Copy link
Author

/cc @marquiz

@PiotrProkop
Copy link
Contributor

if we don't want to mount /proc to the NFD worker we can also read socket_id from sysfs example:

cat /sys/devices/system/cpu/cpu0/topology/physical_package_id

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @AhmedGrati.

Instead of grepping /proc/cpuinfo (and mounting /proc from the host) we should get the information from sysfs. For example, iterate over cpu devices and read their topology/physical_package_id. Number of unique ids is the number of sockets. I think we already loop over all cpus when checking for smt so we should be able to hook the new functionality there.

@AhmedGrati AhmedGrati force-pushed the feat-add-cpu-socket-number branch 2 times, most recently from d362c6f to 981b890 Compare December 13, 2023 22:53
@AhmedGrati
Copy link
Author

Thanks @marquiz @PiotrProkop. PTAL.

@marquiz
Copy link
Contributor

marquiz commented Dec 14, 2023

/milestone v0.15

@k8s-ci-robot k8s-ci-robot added this to the v0.15 milestone Dec 14, 2023
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Two suggestions below

source/cpu/cpu.go Outdated Show resolved Hide resolved
source/cpu/cpu.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2023
source/cpu/cpu.go Outdated Show resolved Hide resolved
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AhmedGrati 👍

We can add the label later if there is high demand for that

@marquiz
Copy link
Contributor

marquiz commented Dec 15, 2023

/assign @ArangoGutierrez

Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 15, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 20e7fc46e64c7cb531f6bb1afa85c19e88d6d15b

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AhmedGrati, ArangoGutierrez, marquiz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ArangoGutierrez,marquiz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Merging #1497 (ebb0836) into master (794630f) will increase coverage by 0.56%.
Report is 24 commits behind head on master.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1497      +/-   ##
==========================================
+ Coverage   30.66%   31.23%   +0.56%     
==========================================
  Files          58       59       +1     
  Lines        7571     7671     +100     
==========================================
+ Hits         2322     2396      +74     
- Misses       4998     5025      +27     
+ Partials      251      250       -1     
Files Coverage Δ
source/cpu/cpu.go 24.41% <0.00%> (-3.11%) ⬇️

... and 11 files with indirect coverage changes

@k8s-ci-robot k8s-ci-robot merged commit 3ea2a38 into kubernetes-sigs:master Dec 15, 2023
14 checks passed
@marquiz marquiz mentioned this pull request Dec 20, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the CPU Socket information
6 participants