func setup() { // zero-sized directory just for mounts if err := os.MkdirAll(mountDir, 0777); err != nil { panic(err) } if err := mount.MountTmpfs(mountDir, 0); err != nil { panic(err) } if err := mount.MountTmpfs("/dev/shm", 14<<30); err != nil { panic(err) } if err := mount.MountHugetlbfs("/dev/hugepages", 2<<20, 4<<30); err != nil { panic(err) } setupDone = true }
func setup() { if setupDone { return } mount.MountNamespace() if err := mount.MountTmpfs("/dev/shm", *tmpfsSize); err != nil { panic(err) } if err := mount.MountHugetlbfs("/dev/hugepages", 2<<20, *hugeSize); err != nil { panic(err) } setupDone = true }