Rate This Document
Findability
Accuracy
Completeness
Readability

Code Implementation

Table 1 lists the new classes of the feature.

Table 1 New classes

Class

Description

Sched_affinity_manager

Scheduling manager interface.

  • The register_thread method is used to register itself with the scheduling manager when a thread starts, and then its scheduling is managed by the scheduling manager.
  • The unregister_thread method is used to deregister a thread from the scheduling manager before the thread is destroyed.
  • The rebalance_group method is used to update the internal status of the scheduling manager and the scheduling status of the existing threads when CPU core parameters are changed.
  • The update_numa_aware method is used to update the internal status of the scheduling manager and the scheduling status of the existing threads when the sched_affinity_numa_aware parameter is changed.
  • The take_group_snapshot method is used to return a snapshot of the internal status of the scheduler manager, in the form of a string. The snapshot can be queried by the user.
  • The get_total_node_number method is used to return the total number of NUMA nodes in the system.
  • The get_cpu_number_per_node method is used to return the number of cores on each NUMA node in the system.
  • The check_cpu_string method is used to check the validity of the input CPU cores.

Sched_affinity_manager_numa

Implements the scheduling manager.

Sched_affinity_manager_dummy

Standby for implementing the scheduling manager. The implementation of all interfaces only returns values that meet the caller's expectation.

If Sched_affinity_manager_numa is unavailable (for example, the libnuma dependency does not meet the requirements), Sched_affinity_manager_dummy is enabled.