Skip to content

Conversation

cyphar
Copy link
Owner

@cyphar cyphar commented Aug 29, 2025

There appears to be an insanely difficult to debug performance pathology
with their backport (which I've struggled to debug for many weeks now).
It's time to just cut our losses and not bother trying to use this
feature on kernels that tried to backport it.

/cc @kolyshkin
Signed-off-by: Aleksa Sarai [email protected]

Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 34.55497% with 125 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/gocompat/gocompat_generics_unsupported.go 0.00% 104 Missing ⚠️
internal/gocompat/gocompat_generics_go121.go 0.00% 14 Missing ⚠️
internal/kernelversion/kernel_linux.go 88.67% 4 Missing and 2 partials ⚠️
procfs_linux.go 92.30% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

cyphar added 2 commits August 30, 2025 00:51
This also lets us rename them and remove the nolint:revive lines.

Signed-off-by: Aleksa Sarai <[email protected]>
We need sync.OnceValues again, but while we're at it lets get the
slightly performance optimised versions from Go 1.25.

Signed-off-by: Aleksa Sarai <[email protected]>
File copied from
https://github.com/opencontainers/runc/blob/v1.3.0/libcontainer/system/kernelversion/kernel_linux.go

(Aleksa: Maybe we should put this somewhere more useful for everyone?)
Copy link
Contributor

@kolyshkin kolyshkin Aug 29, 2025

Choose a reason for hiding this comment

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

I don't really like containerd's implementation, seems a tad over-engineered to me. There's a Go internal implementation which is way simpler, see https://github.com/golang/go/blob/master/src/internal/syscall/unix/kernel_version_linux.go

It returns two integers, which every programmer can compare.

If there's interest, I can try adding it to moby/sys.

Copy link
Owner Author

Choose a reason for hiding this comment

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

which every programmer can compare.

You'd be surprised with how many people I've seen screw this up.

Copy link
Owner Author

Choose a reason for hiding this comment

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

That being said, I would prefer to not have a KernelVersion type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened moby/sys#204, let's see what other maintainers think of it.

@cyphar cyphar force-pushed the rhel8-fuckery branch 2 times, most recently from d311fc9 to 19fba9b Compare September 3, 2025 18:40
This was originally intended to be a simple copy of runc's internal
kernelversion package (which was derived from containerd, in turn
derived from Docker). However, the runc one is quite over-complicated
and uses quite confusing terminology and so I went ahead and wrote a
more generic but less complicated version.

It is very loosely based on the Go stdlib's kernelversion but completely
rewritten and extended to support more than 2-digit kernel versions (for
2.6.x support) and with quite a few added tests.

Signed-off-by: Aleksa Sarai <[email protected]>
There appears to be an insanely difficult to debug performance pathology
with their backport (which I've struggled to debug for many weeks now).
It's time to just cut our losses and not bother trying to use this
feature on kernels that tried to backport it.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar merged commit baae994 into main Sep 10, 2025
45 checks passed
@cyphar cyphar deleted the rhel8-fuckery branch September 10, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants