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

bpf,datapath: read jiffies from /proc/schedstat #25795

Merged
merged 1 commit into from
May 31, 2023

Conversation

ti-mo
Copy link
Contributor

@ti-mo ti-mo commented May 31, 2023

The Cilium agent has been throwing the 'Auto-disabling "enable-bpf-clock-probe" feature since kernel doesn't expose /proc/timer_list' warning for a while now.

Since /proc/timer_list is not available under the default k8s SecurityContext and Docker also masks the file by default, read it from /proc/schedstat instead.

Reuse the existing parsing code from probes.KernelHZ to obtain the value.

Fixes: #25463

Backporting to 1.13 only since 1.12 doesn't have the new /proc/schedstat reader infra yet.

bpf,datapath: read jiffies from /proc/schedstat

The Cilium agent has been throwing the 'Auto-disabling "enable-bpf-clock-probe"
feature since kernel doesn't expose /proc/timer_list' warning for a while now.

Since /proc/timer_list is not available under the default k8s SecurityContext
and Docker also masks the file by default, read it from /proc/schedstat instead.

Reuse the existing parsing code from probes.KernelHZ to obtain the value.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo added kind/bug This is a bug in the Cilium logic. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/bug This PR fixes an issue in a previous release of Cilium. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels May 31, 2023
@ti-mo ti-mo requested review from a team as code owners May 31, 2023 13:29
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.13.3 May 31, 2023
@ti-mo ti-mo added the release-blocker/1.14 This issue will prevent the release of the next version of Cilium. label May 31, 2023
@ti-mo
Copy link
Contributor Author

ti-mo commented May 31, 2023

/test

Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

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

Probably should have asked that back when we introduced the probe that relies on /proc/schedstat: Should we add CONFIG_SCHEDSTATS=y as a system requirement (for certain features) somewhere? I just realized that it's not set on my kernel and I'm missing /proc/schedstat.

@ti-mo ti-mo merged commit 8531c5a into cilium:main May 31, 2023
62 checks passed
@ti-mo ti-mo deleted the tb/schedstat-jiffies branch May 31, 2023 19:16
@pchaigno
Copy link
Member

Probably should have asked that back when we introduced the probe that relies on /proc/schedstat: Should we add CONFIG_SCHEDSTATS=y as a system requirement (for certain features) somewhere? I just realized that it's not set on my kernel and I'm missing /proc/schedstat.

I think we should document it at https://docs.cilium.io/en/stable/operations/system_requirements/#linux-kernel.

@sayboras sayboras mentioned this pull request Jun 2, 2023
8 tasks
@sayboras sayboras added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. and removed needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels Jun 2, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.13 in 1.13.3 Jun 2, 2023
@YutaroHayakawa YutaroHayakawa added backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Jun 7, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.13 to Backport done to v1.13 in 1.13.3 Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. kind/bug This is a bug in the Cilium logic. release-blocker/1.14 This issue will prevent the release of the next version of Cilium. release-note/bug This PR fixes an issue in a previous release of Cilium. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
No open projects
1.13.3
Backport done to v1.13
Development

Successfully merging this pull request may close these issues.

BPF jiffies never enabled due to missing /proc/timer_list
6 participants