summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/controller.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2019-03-14 08:11:36 -0700
committerShentubot <shentubot@google.com>2019-03-14 08:12:48 -0700
commit8f4634997bd97810a85a70b71f000378d9db2e55 (patch)
tree903096f91ee8f201fa622296e0f04cf7c7cd9013 /runsc/boot/controller.go
parentfb9919881c7dc98eaf97cad2a70d187bd78f1566 (diff)
Decouple filemem from platform and move it to pgalloc.MemoryFile.
This is in preparation for improved page cache reclaim, which requires greater integration between the page cache and page allocator. PiperOrigin-RevId: 238444706 Change-Id: Id24141b3678d96c7d7dc24baddd9be555bffafe4
Diffstat (limited to 'runsc/boot/controller.go')
-rw-r--r--runsc/boot/controller.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index a864be720..14e1eba5b 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -332,6 +332,11 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
k := &kernel.Kernel{
Platform: p,
}
+ mf, err := createMemoryFile()
+ if err != nil {
+ return fmt.Errorf("creating memory file: %v", err)
+ }
+ k.SetMemoryFile(mf)
cm.l.k = k
// Set up the restore environment.
@@ -362,7 +367,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
loadOpts := state.LoadOpts{
Source: o.FilePayload.Files[0],
}
- if err := loadOpts.Load(k, p, networkStack); err != nil {
+ if err := loadOpts.Load(k, networkStack); err != nil {
return err
}
@@ -384,7 +389,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
cm.l.mu.Lock()
eid := execID{cid: o.SandboxID}
cm.l.processes = map[execID]*execProcess{
- eid: &execProcess{
+ eid: {
tg: cm.l.k.GlobalInit(),
},
}