mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Mark nvproxy.objsLive as not savable.
We do not restore GPU state on restore. Any nvproxy state is also not restored. So nvproxy.objsLive should not be saved. After this change, we release all live objects on checkpoint. Updates #9363, #9649, #9767 PiperOrigin-RevId: 590661915
This commit is contained in:
@@ -70,9 +70,9 @@ func Register(vfsObj *vfs.VirtualFilesystem, versionStr string, uvmDevMajor uint
|
||||
|
||||
// +stateify savable
|
||||
type nvproxy struct {
|
||||
objsMu objsMutex `state:"nosave"`
|
||||
objsLive map[nvgpu.Handle]*object
|
||||
abi *driverABI `state:"nosave"`
|
||||
objsMu objsMutex `state:"nosave"`
|
||||
objsLive map[nvgpu.Handle]*object `state:"nosave"`
|
||||
abi *driverABI `state:"nosave"`
|
||||
version DriverVersion
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,20 @@ package nvproxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/abi/nvgpu"
|
||||
"gvisor.dev/gvisor/pkg/context"
|
||||
)
|
||||
|
||||
func (n *nvproxy) beforeSave() {
|
||||
n.objsMu.Lock()
|
||||
defer n.objsMu.Unlock()
|
||||
for _, o := range n.objsLive {
|
||||
o.Release(context.Background())
|
||||
}
|
||||
n.objsLive = nil
|
||||
}
|
||||
|
||||
func (n *nvproxy) afterLoad() {
|
||||
Init()
|
||||
abiCons, ok := abis[n.version]
|
||||
@@ -25,4 +37,5 @@ func (n *nvproxy) afterLoad() {
|
||||
panic(fmt.Sprintf("driver version %q not found in abis map", n.version))
|
||||
}
|
||||
n.abi = abiCons.cons()
|
||||
n.objsLive = make(map[nvgpu.Handle]*object)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user