opencontainers / opencontainers/runc

PageSize missing from HugetlbStats

Open
#3,569 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

Hugepage may have different sizes,e.g. 2MB,1GB, the data carried by HugetlbStats is insufficient to provide the real hugepage information. HugetlbStats defined in https://github.com/opencontainers/runc/blob/main/libcontainer/cgroups/stats.go#L138, and PageSize is missing from HugetlbStats. on the other hand, https://github.com/containerd/cgroups/blob/main/stats/v1/metrics.proto#L23 has cantain pagesize already.

take containerd to show the issue, https://github.com/containerd/containerd/blob/main/metrics/cgroups/v1/hugetlb.go#L43 use the pagesize, but pagesize is empty, because libcontainer don't give pagesize infomation, containerd will get two metrics for one container(one metrics for 2MB, one metrics for 1GB),and the two metrics have same value, this will lead prometheus error:

An error has occurred while serving metrics:

42 error(s) occurred:
* collected metric "container_hugetlb_usage_bytes" { label:<name:"container_id" value:"21a24f24209904b7eddf3b2b4315462e2c38a3c81da48400aecc4022f4403e63" > label:<name:"namespace" value:"k8s.io" > label:<name:"page" value:"" > gauge:<value:0 > } was collected before with the same name and label values
* collected metric "container_hugetlb_failcnt_total" { label:<name:"container_id" value:"21a24f24209904b7eddf3b2b4315462e2c38a3c81da48400aecc4022f4403e63" > label:<name:"namespace" value:"k8s.io" > label:<name:"page" value:"" > gauge:<value:0 > } was collected before with the same name and label values
* collected metric "container_hugetlb_max_bytes" { label:<name:"container_id" value:"21a24f24209904b7eddf3b2b4315462e2c38a3c81da48400aecc4022f4403e63" > label:<name:"namespace" value:"k8s.io" > label:<name:"page" value:"" > gauge:<value:0 > } was collected before with the same name and label values
...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libcontainer/cgroups/stats.go at the HugetlbStats definition, then compare the related metrics.proto and containerd hugetlb.go references named in the issue. Trace how hugepage statistics are populated and confirm that distinct 2MB and 1GB pages retain their page-size information. Done means consumers no longer receive duplicate empty page labels for different hugepage sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.