← Back to Pull requests

libpod: move pasta and rootlessport into the conmon cgroup #29823

Merged
giuseppe merged 47 files (1509 lines) on Nov 05, 2026 12:12 UTC
View on GitHub
giuseppe giuseppe commented on Sep 23, 2026 10:40 UTC
Author

When podman owns the conmon cgroup it only ever put conmon there. The per-container network helpers stayed in whatever cgroup the invoking podman happened to live in so their resources were not accounted to the container and their lifetime was tied to an unrelated cgroup.

Put them in the same cgroup as conmon.

Closes: https://github.com/podman-container-tools/podman/issues/29582

Needs: https://github.com/podman-container-tools/container-libs/pull/1207

``release-note
None
``

Diff: 1509 lines (+1150 / -359) across 47 files Reviewer: Honny1 Review duration: 62012m
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.72) × (1 − Review Confidence (0.86)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 1509 lines diff across 47 files
0.72
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.82 · 5 substantive comment(s)
0.82
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.400
Mass File Touch mass_file_touch
0.080
Real PR Conversation Timeline
16 items
Honny1 Honny1 commented on code on Sep 23, 2026 12:32 UTC
Code Review
libpod/oci_conmon_linux.go:1
@@ -164,67 +161,20 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func
 	return err
 }
 
-// Create systemd unit name for cgroup scopes.
-func createUnitName(prefix string, name string) string {
-	return fmt.Sprintf("%s-%s.scope", prefix, name)
-}
-
 // moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
 // it then signals for conmon to start by sending nonce data down the start fd
 func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {

Should this be renamed? Now, it doesn't move only the common process.

Honny1 Honny1 commented on Sep 23, 2026 12:34 UTC
Reviewer

I think the CI failures are related. I just have a naming concern now. Also, the commit message should say Fixes: instead of Closes:.

sarthakkaushik927 sarthakkaushik927 commented on Sep 23, 2026 12:38 UTC
Contributor

<img width="1833" height="856" alt="image" src="https://github.com/user-attachments/assets/6a7c90a1-1782-45c7-ac74-954bac07c6f8" />

@giuseppe, Just a heads-up regarding the failing CI checks: the cockpit-revdeps tests are currently failing because the test environment is missing the systemd-container package.

If you look at the bottom of the logs for the browser tests, it fails with:
./browser.sh: line 88: systemd-nspawn: command not found

My PR #29803 was hitting this exact same infrastructure failure earlier today, so it has nothing to do with your code changes. The code looks great!

link:https://artifacts.dev.testing-farm.io/e84b398e-901d-4825-be77-02520f2dfd97

packit-as-a-service[bot] packit-as-a-service[bot] commented on Sep 23, 2026 13:58 UTC
Bot

[NON-BLOCKING] Packit jobs failed. @podman-container-tools/packit-jobs please check. Everyone else, feel free to ignore.

giuseppe giuseppe commented on Sep 23, 2026 16:30 UTC
Author

I think the CI failures are related. I just have a naming concern now. Also, the commit message should say Fixes: instead of Closes:.

yes, CI failures were related, we need this ugly workaround for now: https://github.com/podman-container-tools/container-libs/pull/1207/changes#r4084790065

Honny1 Honny1 commented on Sep 24, 2026 09:37 UTC
Reviewer

Code LGTM,

PTAL @sbrivio-rh

mnrx mnrx commented on code on Oct 02, 2026 04:57 UTC
Code Review
libpod/oci_conmon_linux.go:1
@@ -164,67 +161,20 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func
 	return err
 }
 
-// Create systemd unit name for cgroup scopes.
-func createUnitName(prefix string, name string) string {
-	return fmt.Sprintf("%s-%s.scope", prefix, name)
-}
-
 // moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
 // it then signals for conmon to start by sending nonce data down the start fd
 func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {

In my issue I suggested libpod-support-<CONTAINER_ID>.scope may be a more accurate name for the control group if it contains more processes, but you may consider this a breaking change. I think keeping the function and control group names in sync is best, i.e., change both or neither.

mnrx mnrx commented on Oct 02, 2026 05:03 UTC
Contributor

I've read through most of these changes (excluding vendor/), and everything seems to match what we discussed on the issue. Thanks! I think there are some other related issues, but I'll re-evaluate them once I can test this. Will this only land in a 6.x release?

github-actions[bot] github-actions[bot] commented on Nov 02, 2026 01:29 UTC
Bot

A friendly reminder that this PR had no activity for 30 days.

Honny1 Honny1 commented on Nov 02, 2026 11:23 UTC
Contributor

@giuseppe, I think the container libs PR has been merged.

Honny1 Honny1 commented on code on Nov 05, 2026 10:29 UTC
Code Review
libpod/oci_conmon_linux.go:1
@@ -164,11 +164,17 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func
 // moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
 // it then signals for conmon to start by sending nonce data down the start fd
 func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {
-	if err := ctr.moveToConmonCgroup(cmd.Process.Pid); err != nil {
+	// The per-container network helpers belong in the same cgroup as conmon.
+	// They are usually started before conmon, so they can go in together with
+	// it; the orderings where they are not are handled in configureNetNS().
+	pids := append([]int{cmd.Process.Pid}, ctr.netHelperPids()...)

Should this also be mentioned in the function's name or comment?

Honny1 Honny1 commented on Nov 05, 2026 10:30 UTC
Reviewer

Just one naming comment. Othervise LGTM.

giuseppe giuseppe commented on code on Nov 05, 2026 11:04 UTC
Code Review
libpod/oci_conmon_linux.go:1
@@ -164,11 +164,17 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func
 // moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
 // it then signals for conmon to start by sending nonce data down the start fd
 func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {
-	if err := ctr.moveToConmonCgroup(cmd.Process.Pid); err != nil {
+	// The per-container network helpers belong in the same cgroup as conmon.
+	// They are usually started before conmon, so they can go in together with
+	// it; the orderings where they are not are handled in configureNetNS().
+	pids := append([]int{cmd.Process.Pid}, ctr.netHelperPids()...)

sure.

I've amended the following patch:

diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index c5ef48fa3f..4414622be9 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -161,7 +161,8 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func
        return err
 }

-// moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
+// moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process
+// and the per-container network helpers to the conmon cgroup below it
 // it then signals for conmon to start by sending nonce data down the start fd
 func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {
        // The per-container network helpers belong in the same cgroup as conmon.

Honny1 Honny1 approved these changes on Nov 05, 2026 11:07 UTC
Approved Reviewer

LGTM

Luap99 Luap99 approved these changes on Nov 05, 2026 12:12 UTC
Approved Reviewer

LGTM

Reviewers
Assignees
giuseppe giuseppe
Labels
risk: low confidence: 86.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 71.5% (HIGH) · Higher = larger blast radius
71.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 86.5% · Lower = rushed or shallow review
86.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 9.7% · Safe to merge
9.7%