示例#1
0
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()));
}
示例#2
0
CoreControlStatus CoreControlArbitrator::arbitrate(UIntN policyIndex, const CoreControlStatus& coreControlStatus)
{
	auto tempPolicyRequests = m_requestedActiveCoreCount;
	tempPolicyRequests[policyIndex] = coreControlStatus.getNumActiveLogicalProcessors();
	UIntN minActiveCoreCount = getMinActiveCoreCount(tempPolicyRequests);
	return CoreControlStatus(minActiveCoreCount);
}
示例#3
0
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;
}
示例#4
0
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());
}
示例#5
0
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.");
	}
}
示例#6
0
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.");
    }
}