From patchwork Thu Oct 8 21:53:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Marko X-Patchwork-Id: 100214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79AFCCA6015 for ; Thu, 8 Oct 2026 21:54:01 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5966.1791496439385425540 for ; Thu, 08 Oct 2026 14:53:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.marko@siemens.com header.s=fm1 header.b=SllcudGW; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-256628-202610082153572fa51388c9000207c6-_r1ghp@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202610082153572fa51388c9000207c6 for ; Thu, 08 Oct 2026 23:53:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.marko@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=rDi5EDqt1ynLxSF3muNT4ZsJ0I4uIfeCv/Tt4LqmlNA=; b=SllcudGWPxOxXpRNBrROE1/Uj0OSg9PXE89rHa4O3BXGPxlVKsEcPU/GWYQZQKNbv2tVYA UkIwoitvbsOcocSmK4CY5sp1lygSfeBrjnzo0aWDCH8mU4JgGBOdkbHBbcU1JU9OrXjfslWm Hj4a6aozE4ngW3oVSQOe+OcJX/a18FfpK9uEiocrR0Sj328MfA7CIV3ACt13WJlj4N3HF91T f53MEaHe8YCXZD/OsL/z87ZgLNVjnbNqmGicjeHDy2+THO1OF4MrXpgF6H1whi94OE4DDENO pGXVE0n2uvUryKSCJEtZ3Njcp1RCePARe1+vBzAK5SJD+bd0VU7LPNzw==; From: Peter Marko To: openembedded-core@lists.openembedded.org Cc: Peter Marko Subject: [blacksail][PATCH 1/2] go: skip internal/cgrouptest when cpu.max is not available Date: Thu, 8 Oct 2026 23:53:11 +0200 Message-ID: <20261008215312.625598-1-peter.marko@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-256628:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 08 Oct 2026 21:54:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/247450 From: Khem Raj The internal/cgrouptest ptest fails on qemux86-64: Erroring setting cpu.max: open /sys/fs/cgroup/go-cgrouptestNNN/cpu.max: permission denied cpu.max is only present in cgroup v2 when the kernel is built with CONFIG_CFS_BANDWIDTH, which the linux-yocto qemu configuration does not enable, even though the cpu controller is available. Writing the missing file makes cgroupfs return EACCES. Add a patch so that InCgroupV2 skips the test when the new cgroup has no cpu.max, consistent with its other best-effort checks. Signed-off-by: Khem Raj Signed-off-by: Richard Purdie (From OE-Core rev: 7b925b30e4753bd3698792b83f18e0848a85ba3f) Signed-off-by: Peter Marko --- meta/recipes-devtools/go/go-1.27.1.inc | 1 + ...est-skip-when-cpu.max-is-not-availab.patch | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 meta/recipes-devtools/go/go/0011-internal-cgrouptest-skip-when-cpu.max-is-not-availab.patch diff --git a/meta/recipes-devtools/go/go-1.27.1.inc b/meta/recipes-devtools/go/go-1.27.1.inc index 61df45558d..d7ba03b1bd 100644 --- a/meta/recipes-devtools/go/go-1.27.1.inc +++ b/meta/recipes-devtools/go/go-1.27.1.inc @@ -15,5 +15,6 @@ SRC_URI += "\ file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \ file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \ file://0010-cmd-go-clear-GOROOT-for-func-ldShared-when-trimpath-.patch \ + file://0011-internal-cgrouptest-skip-when-cpu.max-is-not-availab.patch \ " SRC_URI[main.sha256sum] = "4e408abae126d916b6164627193f2c54f0e3ca1312d693b86db45f862ab238b1" diff --git a/meta/recipes-devtools/go/go/0011-internal-cgrouptest-skip-when-cpu.max-is-not-availab.patch b/meta/recipes-devtools/go/go/0011-internal-cgrouptest-skip-when-cpu.max-is-not-availab.patch new file mode 100644 index 0000000000..f13cf78f7a --- /dev/null +++ b/meta/recipes-devtools/go/go/0011-internal-cgrouptest-skip-when-cpu.max-is-not-availab.patch @@ -0,0 +1,39 @@ +From 3335a08288a68ebce5f3e99745186ded36c564c9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 24 Sep 2026 10:22:23 -0700 +Subject: [PATCH] internal/cgrouptest: skip when cpu.max is not available + +The cpu.max interface file is only present in cgroup v2 when the kernel +is built with CONFIG_CFS_BANDWIDTH, even if the cpu controller is enabled +in the parent's cgroup.subtree_control. Without it, SetCPUMax tries to +create the file, which cgroupfs rejects with EACCES, and TestInCgroupV2 +fails with: + + Erroring setting cpu.max: open /sys/fs/cgroup/go-cgrouptestNNN/cpu.max: permission denied + +Skip, like the other best-effort checks in InCgroupV2, when the new +cgroup does not have cpu.max. + +Upstream-Status: Submitted [https://github.com/golang/go/pull/81745] +Signed-off-by: Khem Raj +--- + src/internal/cgrouptest/cgrouptest_linux.go | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/internal/cgrouptest/cgrouptest_linux.go b/src/internal/cgrouptest/cgrouptest_linux.go +index ad9599c..a4b9b52 100644 +--- a/src/internal/cgrouptest/cgrouptest_linux.go ++++ b/src/internal/cgrouptest/cgrouptest_linux.go +@@ -82,6 +82,12 @@ func InCgroupV2(t *testing.T, fn func(*CgroupV2)) { + } + }() + ++ // cpu.max only exists when the kernel supports CPU bandwidth control ++ // (CONFIG_CFS_BANDWIDTH), even if the cpu controller is enabled. ++ if _, err := os.Stat(filepath.Join(path, "cpu.max")); err != nil { ++ t.Skipf("cgroup %s does not support cpu.max: %v", path, err) ++ } ++ + migrateTo(t, path) + defer migrateTo(t, orig) +