Skip to content

Commit

Permalink
Merge pull request #793 from luomingmeng/dev/fix-qrm-cpu-memory-state…
Browse files Browse the repository at this point in the history
…-restore

fix(qrm): qrm cpu/memory plugin state restore include headroom
  • Loading branch information
gary-lgy authored Feb 27, 2025
2 parents 006edc1 + f350da7 commit 19914b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (sc *stateCheckpoint) RestoreState(topology *machine.CPUTopology) error {

sc.cache.SetMachineState(generatedMachineState)
sc.cache.SetPodEntries(checkpoint.PodEntries)
sc.cache.SetNUMAHeadroom(checkpoint.NUMAHeadroom)
sc.cache.SetAllowSharedCoresOverlapReclaimedCores(checkpoint.AllowSharedCoresOverlapReclaimedCores)

if !reflect.DeepEqual(generatedMachineState, checkpoint.MachineState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (sc *stateCheckpoint) restoreState(machineInfo *info.MachineInfo, reservedM
}

sc.cache.SetMachineState(generatedResourcesMachineState)
sc.cache.SetNUMAHeadroom(checkpoint.NUMAHeadroom)
sc.cache.SetPodResourceEntries(checkpoint.PodResourceEntries)

if !reflect.DeepEqual(generatedResourcesMachineState, checkpoint.MachineState) {
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/spd/cnc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func Test_cncCacheController_Run(t *testing.T) {
go spdController.Run()
synced := cache.WaitForCacheSync(ctx.Done(), spdController.syncedFunc...)
assert.True(t, synced)
spdController.cncCacheController.clearUnusedConfig()
time.Sleep(1 * time.Second)

newCNC, err := controlCtx.Client.InternalClient.ConfigV1alpha1().CustomNodeConfigs().
Expand Down

0 comments on commit 19914b2

Please sign in to comment.