Resource Tuner
Loading...
Searching...
No Matches
TargetRegistry Class Reference

TargetRegistry. More...

#include <TargetRegistry.h>

Public Member Functions

int32_t getPhysicalCoreId (int32_t logicalClusterId, int32_t logicalCoreId)
 Called by the Verifier to get the physical core ID corresponding to the Logical Core ID value.
 
int32_t getPhysicalClusterId (int32_t logicalClusterId)
 Called by the Verifier to get the physical Cluster ID corresponding to the Logical Cluster ID value.
 
void readTargetInfo ()
 Called during Server Init, to read and Parse the Logical To Physical Core / Cluster Mappings.
 

Detailed Description

TargetRegistry.

Stores all the target related info, fetched dynamically or provided statically via Target and Init Config files.

Definition at line 80 of file TargetRegistry.h.

Member Function Documentation

◆ getPhysicalClusterId()

int32_t TargetRegistry::getPhysicalClusterId ( int32_t  logicalClusterId)

Called by the Verifier to get the physical Cluster ID corresponding to the Logical Cluster ID value.

This routine performs Logical to Physical Cluster Translation.

Parameters
logicalClusterIdThe Logical Cluster ID, passed via the mResInfo field (part of the Resource struct) when issuing a tuneResources API call.
Returns
int32_t:
  • A Non-Negative Integer, representing the corresponding physical Cluster ID.
  • -1: otherwise

◆ getPhysicalCoreId()

int32_t TargetRegistry::getPhysicalCoreId ( int32_t  logicalClusterId,
int32_t  logicalCoreId 
)

Called by the Verifier to get the physical core ID corresponding to the Logical Core ID value.

This routine performs Logical to Physical Core Translation.

Parameters
logicalClusterIdThe Logical Cluster ID, passed via the mResInfo field (part of the Resource struct) when issuing a tuneResources API call.
logicalCoreIdThe Logical Core ID, passed via the mResInfo field (part of the Resource struct) when issuing a tuneResources API call.
Returns
int32_t:
  • A Non-Negative Integer, representing the corresponding physical Core ID.
  • -1: otherwise

◆ readTargetInfo()

void TargetRegistry::readTargetInfo ( )

Called during Server Init, to read and Parse the Logical To Physical Core / Cluster Mappings.

This routine will extract the physical Core IDs and the list of CPU cores part of each Physical Cluster This data will be used to perform Logical to Physical Translation for each incoming tuneResources Request later on, if it contains any Resource which has ApplyType set to Core.

Note: This function tries to use different strategies to get the Core / Cluster Enumeration and Mapping data:

  • If the BU has provided a mapping file, it will be used. This mapping file should contain data specifying the total Number of Cores / Clusters, mapping of Cluster Type to Physical IDs and Number of Cores in each Cluster.
  • If no such file is provided, we try to generate the mappings dynamically by reading the policy directories located in /sys/devices/system/cpu/cpufreq/
  • If even the above strategy fails, we default to using Simple Heuristic based approach, where we divided the number of Online CPU cores as evenly as possible among the Cluster Types.
  • If even the above strategy fails, the function will return an Error.

The documentation for this class was generated from the following file: