sysfs: tolerate EFBIG when reading cpufreq stats/trans_table#852
Open
kevinpark1217 wants to merge 1 commit into
Open
sysfs: tolerate EFBIG when reading cpufreq stats/trans_table#852kevinpark1217 wants to merge 1 commit into
kevinpark1217 wants to merge 1 commit into
Conversation
The kernel refuses to export stats/trans_table when the table exceeds
PAGE_SIZE ("cpufreq transition table exceeds PAGE_SIZE. Disabling",
drivers/cpufreq/cpufreq_stats.c) and reads then fail with EFBIG. This
is common on CPUs with many frequency states, e.g. NVIDIA Jetson
(Tegra): SystemCpufreq() fails wholesale, which surfaces in
node_exporter as the cpufreq collector failing on every scrape and
losing all cpufreq metrics for the node.
Treat EFBIG like an absent file, matching the existing ENOENT/EPERM
tolerance for this optional stats file.
Verified on a Jetson Orin Nano: SystemCpufreq() fails with "file too
large" before this change and returns all 6 policy entries after.
Signed-off-by: Kevin Park <kevin.park1217@gmail.com>
kevinpark1217
force-pushed
the
cpufreq-trans-table-efbig
branch
from
July 23, 2026 15:40
b69b0c7 to
a29d281
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kernel disables the export of
stats/trans_tablewhen the rendered table exceedsPAGE_SIZE, and reads then fail withEFBIG(drivers/cpufreq/cpufreq_stats.c,show_trans_table). This is the normal state on CPUs with many frequency states, e.g. NVIDIA Jetson/Tegra.SystemCpufreq()tolerates onlyENOENT/EPERMat this read, so it fails wholesale on such hardware — downstream, node_exporter's cpufreq collector fails on every scrape (collector failed … trans_table: file too large) and all cpufreq metrics for the node are lost. Same root cause as grafana/alloy#6132.Fix: treat
EFBIGlike an absent file, matching the existingENOENT/EPERMtolerance for this optional stats file.Verified on a Jetson Orin Nano:
SystemCpufreq()fails withfile too largebefore this change and returns all 6 policy entries after.go test ./sysfs/passes. No new unit test:EFBIGis a kernel-runtime error that can't be represented by the fixture files — this takes the same branch as the existingENOENT/EPERMhandling.cc @SuperQ