summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2019-04-30 13:55:41 -0700
committerShentubot <shentubot@google.com>2019-04-30 13:56:41 -0700
commit8bfb83d0acdea553082b897d3fd0ad1c1580eaa9 (patch)
treea06cd3e3295c1397cce8a234bc15b795b30eb92e /runsc/boot
parent81ecd8b6eab7457b331762626f8c210fec3504e6 (diff)
Implement async MemoryFile eviction, and use it in CachingInodeOperations.
This feature allows MemoryFile to delay eviction of "optional" allocations, such as unused cached file pages. Note that this incidentally makes CachingInodeOperations writeback asynchronous, in the sense that it doesn't occur until eviction; this is necessary because between when a cached page becomes evictable and when it's evicted, file writes (via CachingInodeOperations.Write) may dirty the page. As currently implemented, this feature won't meaningfully impact steady-state memory usage or caching; the reclaimer goroutine will schedule eviction as soon as it runs out of other work to do. Future CLs increase caching by adding constraints on when eviction is scheduled. PiperOrigin-RevId: 246014822 Change-Id: Ia85feb25a2de92a48359eb84434b6ec6f9bea2cb
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/loader.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 0b5be0a42..05122a6a8 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -424,7 +424,7 @@ func createMemoryFile() (*pgalloc.MemoryFile, error) {
return nil, fmt.Errorf("error creating memfd: %v", err)
}
memfile := os.NewFile(uintptr(memfd), memfileName)
- mf, err := pgalloc.NewMemoryFile(memfile)
+ mf, err := pgalloc.NewMemoryFile(memfile, pgalloc.MemoryFileOpts{})
if err != nil {
memfile.Close()
return nil, fmt.Errorf("error creating pgalloc.MemoryFile: %v", err)