@@ -312,13 +312,18 @@ func (pa *ProvisionAssemblerCommon) assembleWithoutNUMAExclusivePool(
312312 poolSizes := make (map [string ]int )
313313 sharePoolSizes := make (map [string ]int )
314314 reclaimablePoolSizes := make (map [string ]int )
315+ nonReclaimableSharePoolSizes := make (map [string ]int )
316+ reclaimableShareRequirements := make (map [string ]int )
315317 reclaimableRequirements := make (map [string ]int )
316318 for poolName , size := range shareAndIsolateDedicatedPoolSizes {
317319 _ , ok := sharePoolSizeRequirements [poolName ]
318320 if ok {
319321 if shareInfo .reclaimEnable [poolName ] {
320322 reclaimablePoolSizes [poolName ] = size
323+ reclaimableShareRequirements [poolName ] = shareInfo .requirements [poolName ]
321324 reclaimableRequirements [poolName ] = shareInfo .requirements [poolName ]
325+ } else {
326+ nonReclaimableSharePoolSizes [poolName ] = size
322327 }
323328 poolSizes [poolName ] = size
324329 sharePoolSizes [poolName ] = size
@@ -340,8 +345,10 @@ func (pa *ProvisionAssemblerCommon) assembleWithoutNUMAExclusivePool(
340345 }
341346
342347 overlapReclaimSize := make (map [string ]int )
348+ // shareReclaimCoresSize is the size of cores that can be reclaimed from share pools
343349 shareReclaimCoresSize := shareAndIsolatedDedicatedPoolAvailable - isolated -
344- general .SumUpMapValues (sharePoolSizeRequirements ) - general .SumUpMapValues (dedicatedPoolSizes )
350+ general .SumUpMapValues (nonReclaimableSharePoolSizes ) - general .SumUpMapValues (reclaimableShareRequirements ) -
351+ general .SumUpMapValues (dedicatedPoolSizes )
345352 if nodeEnableReclaim {
346353 reclaimedCoresSize = shareReclaimCoresSize + dedicatedReclaimCoresSize
347354 if reclaimedCoresSize < reservedForReclaim {
@@ -402,8 +409,15 @@ func (pa *ProvisionAssemblerCommon) assembleWithoutNUMAExclusivePool(
402409 if quotaCtrlKnobEnabled && numaID != commonstate .FakedNUMAID && len (poolSizes ) > 0 {
403410 reclaimedCoresQuota = float64 (general .Max (reservedForReclaim , reclaimedCoresSize ))
404411 if shareInfo .minReclaimedCoresCPUQuota != - 1 || dedicatedInfo .minReclaimedCoresCPUQuota != - 1 {
405- reclaimedCoresQuota = general .MaxFloat64 (float64 (reservedForReclaim ),
406- general .MinFloat64 (shareInfo .minReclaimedCoresCPUQuota , dedicatedInfo .minReclaimedCoresCPUQuota ))
412+ if shareInfo .minReclaimedCoresCPUQuota != - 1 {
413+ reclaimedCoresQuota = shareInfo .minReclaimedCoresCPUQuota
414+ }
415+
416+ if dedicatedInfo .minReclaimedCoresCPUQuota != - 1 {
417+ reclaimedCoresQuota = general .MinFloat64 (reclaimedCoresQuota , dedicatedInfo .minReclaimedCoresCPUQuota )
418+ }
419+
420+ reclaimedCoresQuota = general .MaxFloat64 (reclaimedCoresQuota , float64 (reservedForReclaim ))
407421 }
408422
409423 // if cpu quota enabled, set all reclaimable share pool size to reclaimablePoolSizes
@@ -475,7 +489,8 @@ func (pa *ProvisionAssemblerCommon) assembleWithoutNUMAExclusivePool(
475489 }
476490 }
477491
478- nonOverlapReclaimedCoresSize := reclaimedCoresSize - overlapReclaimedCoresSize
492+ // nonOverlapReclaimedCoresSize should be non-negative
493+ nonOverlapReclaimedCoresSize := general .Max (reclaimedCoresSize - overlapReclaimedCoresSize , 0 )
479494 result .SetPoolEntry (commonstate .PoolNameReclaim , numaID , nonOverlapReclaimedCoresSize , reclaimedCoresQuota )
480495
481496 general .InfoS ("assemble reclaim pool entry" ,
0 commit comments