aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/exec.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-12 01:14:03 +0900
committerOphestra <cat@gensokyo.uk>2026-03-12 01:14:03 +0900
commit196b200d0f19c41730db439c62db9b39e424f21f (patch)
tree0723b900cea0816b6501f3933f768fb75453dd49 /internal/pkg/exec.go
parent04e6bc3c5c99d6a99f17cfa5f69f34fe8941aee2 (diff)
container: expose priority and SCHED_OTHER policy
The more explicit API removes the arbitrary limit preventing use of SCHED_OTHER (referred to as SCHED_NORMAL in the kernel). This change also exposes priority value to set. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/exec.go')
-rw-r--r--internal/pkg/exec.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go
index 3bcffafb..998dce70 100644
--- a/internal/pkg/exec.go
+++ b/internal/pkg/exec.go
@@ -39,8 +39,8 @@ type ExecPath struct {
W bool
}
-// SchedPolicy is the [container] scheduling policy.
-var SchedPolicy std.SchedPolicy
+// SetSchedIdle is whether to set [std.SCHED_IDLE] scheduling priority.
+var SetSchedIdle bool
// PromoteLayers returns artifacts with identical-by-content layers promoted to
// the highest priority instance, as if mounted via [ExecPath].
@@ -413,7 +413,8 @@ func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
z.ParentPerm = 0700
z.HostNet = hostNet
z.Hostname = "cure"
- z.SchedPolicy = SchedPolicy
+ z.SetScheduler = SetSchedIdle
+ z.SchedPolicy = std.SCHED_IDLE
if z.HostNet {
z.Hostname = "cure-net"
}