void DomainCoreControl_001::setActiveCoreControl( UIntN participantIndex, UIntN domainIndex, const CoreControlStatus& coreControlStatus) { verifyCoreControlStatus(domainIndex, coreControlStatus); UIntN totalCores = getCoreControlStaticCaps(participantIndex, domainIndex).getTotalLogicalProcessors(); UIntN totalOfflineCoreRequest = totalCores - coreControlStatus.getNumActiveLogicalProcessors(); getParticipantServices()->primitiveExecuteSetAsUInt32( esif_primitive_type::SET_PROC_NUMBER_OFFLINE_CORES, totalOfflineCoreRequest, domainIndex); // Refresh the status m_coreControlStatus.set(CoreControlStatus(coreControlStatus.getNumActiveLogicalProcessors())); }
CoreControlStatus CoreControlArbitrator::arbitrate(UIntN policyIndex, const CoreControlStatus& coreControlStatus) { auto tempPolicyRequests = m_requestedActiveCoreCount; tempPolicyRequests[policyIndex] = coreControlStatus.getNumActiveLogicalProcessors(); UIntN minActiveCoreCount = getMinActiveCoreCount(tempPolicyRequests); return CoreControlStatus(minActiveCoreCount); }
void CoreControlArbitrator::commitPolicyRequest(UIntN policyIndex, const CoreControlStatus& coreControlStatus) { // save the CoreControlStatus at the correct location for this policy m_requestedActiveCoreCount[policyIndex] = coreControlStatus.getNumActiveLogicalProcessors(); UIntN minActiveCoreCount = getMinActiveCoreCount(m_requestedActiveCoreCount); m_arbitratedActiveCoreCount = minActiveCoreCount; }
void DomainCoreControl_001::setActiveCoreControl(UIntN participantIndex, UIntN domainIndex, const CoreControlStatus& coreControlStatus) { verifyCoreControlStatus(domainIndex, coreControlStatus); createCoreControlStaticCapsIfNeeded(domainIndex); UIntN totalCores = m_coreControlStaticCaps->getTotalLogicalProcessors(); UIntN totalOfflineCoreRequest = totalCores - coreControlStatus.getNumActiveLogicalProcessors(); m_participantServicesInterface->primitiveExecuteSetAsUInt32( esif_primitive_type::SET_PROC_NUMBER_OFFLINE_CORES, totalOfflineCoreRequest, domainIndex); // Refresh the status DELETE_MEMORY_TC(m_coreControlStatus); m_coreControlStatus = new CoreControlStatus(coreControlStatus.getNumActiveLogicalProcessors()); }
void DomainCoreControl_001::verifyCoreControlStatus(UIntN domainIndex, const CoreControlStatus& coreControlStatus) { auto caps = getCoreControlDynamicCaps(getParticipantIndex(), domainIndex); if (coreControlStatus.getNumActiveLogicalProcessors() > caps.getMaxActiveCores() || coreControlStatus.getNumActiveLogicalProcessors() < caps.getMinActiveCores()) { throw dptf_exception("Desired number of cores outside dynamic caps range."); } }
void DomainCoreControl_001::verifyCoreControlStatus(UIntN domainIndex, const CoreControlStatus& coreControlStatus) { createCoreControlDynamicCapsIfNeeded(domainIndex); if (coreControlStatus.getNumActiveLogicalProcessors() > m_coreControlDynamicCaps->getMaxActiveCores() || coreControlStatus.getNumActiveLogicalProcessors() < m_coreControlDynamicCaps->getMinActiveCores()) { throw dptf_exception("Desired number of cores outside dynamic caps range."); } }