@@ -171,6 +171,24 @@ func (pa *ProvisionAssemblerCommon) AssembleProvision() (types.InternalCPUCalcul
171
171
// If there is a SNB pool with the same NUMA ID, it will be calculated while processing the SNB pool.
172
172
if shareRegions := pa .regionHelper .GetRegions (regionNuma , configapi .QoSRegionTypeShare ); len (shareRegions ) == 0 {
173
173
calculationResult .SetPoolEntry (r .Name (), regionNuma , int (controlKnob [configapi .ControlKnobNonReclaimedCPURequirementUpper ].Value ))
174
+
175
+ _ , ok := calculationResult .GetPoolEntry (state .PoolNameReclaim , regionNuma )
176
+ if ! ok {
177
+ available := getNUMAsResource (* pa .numaAvailable , r .GetBindingNumas ())
178
+ reservedForReclaim := getNUMAsResource (* pa .reservedForReclaim , r .GetBindingNumas ())
179
+
180
+ isolationRegions := pa .regionHelper .GetRegions (regionNuma , configapi .QoSRegionTypeIsolation )
181
+ isolationSizes := 0
182
+ for _ , ir := range isolationRegions {
183
+ ck , err := ir .GetProvision ()
184
+ if err != nil {
185
+ return types.InternalCPUCalculationResult {}, err
186
+ }
187
+ isolationSizes += int (ck [configapi .ControlKnobNonReclaimedCPURequirementUpper ].Value )
188
+ }
189
+ reclaimedCoresSize := general .Max (available - isolationSizes , 0 ) + reservedForReclaim
190
+ calculationResult .SetPoolEntry (state .PoolNameReclaim , regionNuma , reclaimedCoresSize )
191
+ }
174
192
}
175
193
} else {
176
194
// save limits and requests for isolated region
@@ -242,12 +260,17 @@ func (pa *ProvisionAssemblerCommon) AssembleProvision() (types.InternalCPUCalcul
242
260
243
261
var reclaimPoolSizeOfNonBindingNUMAs int
244
262
if * pa .allowSharedCoresOverlapReclaimedCores {
245
- isolated := shareAndIsolatedPoolAvailable
263
+ isolated := 0
246
264
sharePoolSizes := make (map [string ]int )
247
- for poolName := range sharePoolRequirements {
248
- sharePoolSizes [poolName ] = shareAndIsolatePoolSizes [poolName ]
249
- isolated -= shareAndIsolatePoolSizes [poolName ]
265
+ for poolName , size := range shareAndIsolatePoolSizes {
266
+ _ , ok := sharePoolRequirements [poolName ]
267
+ if ok {
268
+ sharePoolSizes [poolName ] = shareAndIsolatePoolSizes [poolName ]
269
+ } else {
270
+ isolated += size
271
+ }
250
272
}
273
+
251
274
reclaimPoolSizeOfNonBindingNUMAs = general .Max (pa .getNumasReservedForReclaim (* pa .nonBindingNumas ), shareAndIsolatedPoolAvailable - isolated - general .SumUpMapValues (sharePoolRequirements ))
252
275
if ! nodeEnableReclaim {
253
276
reclaimPoolSizeOfNonBindingNUMAs = pa .getNumasReservedForReclaim (* pa .nonBindingNumas )
0 commit comments