aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cmd/mbf/main.go6
-rw-r--r--internal/pkg/exec.go5
-rw-r--r--internal/pkg/pkg.go4
3 files changed, 9 insertions, 6 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 17ae1b05..5ae0d836 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -88,10 +88,12 @@ func main() {
} else if base, err = check.NewAbs(flagBase); err != nil {
return
}
- cache, err = pkg.Open(ctx, msg, 0, flagCures, base)
+
+ var flags int
if flagIdle {
- pkg.SetSchedIdle = true
+ flags &= pkg.CSchedIdle
}
+ cache, err = pkg.Open(ctx, msg, flags, flagCures, base)
return
}).Flag(
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go
index 6b6964fd..fcbf1245 100644
--- a/internal/pkg/exec.go
+++ b/internal/pkg/exec.go
@@ -40,9 +40,6 @@ type ExecPath struct {
W bool
}
-// SetSchedIdle is whether to set [ext.SCHED_IDLE] scheduling priority.
-var SetSchedIdle bool
-
// GetArtifactFunc is the function signature of [FContext.GetArtifact].
type GetArtifactFunc func(Artifact) (*check.Absolute, unique.Handle[Checksum])
@@ -427,7 +424,6 @@ func (a *execArtifact) makeContainer(
z.ParentPerm = 0700
z.HostNet = hostNet
z.Hostname = "cure"
- z.SetScheduler = SetSchedIdle
z.SchedPolicy = ext.SCHED_IDLE
if z.HostNet {
z.Hostname = "cure-net"
@@ -609,6 +605,7 @@ func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
); err != nil {
return
}
+ z.SetScheduler = f.cache.flags&CSchedIdle != 0
var status io.Writer
if status, err = f.GetStatusWriter(); err != nil {
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go
index a542f3d2..0c882bea 100644
--- a/internal/pkg/pkg.go
+++ b/internal/pkg/pkg.go
@@ -503,6 +503,10 @@ const (
// This behaviour significantly reduces performance and is not recommended
// outside of testing a custom [Artifact] implementation.
CValidateKnown = 1 << iota
+
+ // CSchedIdle arranges for the [ext.SCHED_IDLE] scheduling priority to be
+ // set for [KindExec] and [KindExecNet] containers.
+ CSchedIdle
)
// Cache is a support layer that implementations of [Artifact] can use to store