Rate This Document
Findability
Accuracy
Completeness
Readability

kupl_hbw_get_policy

Obtains the current OPM memory allocation policy.

Interface Definition

kupl_hbw_policy_t kupl_hbw_get_policy();

Return Value

  • The current OPM memory allocation policy is returned. For details about the policy, see the following table.
    Table 1 kupl_hbw_policy_t data structure

    Value

    Description

    KUPL_HBW_POLICY_BIND

    Allocates memory from the nearest NUMA OPM node. If the OPM memory is insufficient, the allocation will fail, returning nullptr and reporting an error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <stdio.h>
#include <assert.h>
#include "kupl.h" 
   
int main() 
{ 
    int ret = kupl_hbw_set_policy(KUPL_HBW_POLICY_BIND);
    assert(ret ==  KUPL_OK);
    kupl_hbw_policy_t policy = kupl_hbw_get_policy();
    assert(policy ==  KUPL_HBW_POLICY_BIND);    
    return 0; 
}
  • The preceding example demonstrates how to configure and retrieve the current OPM memory allocation policy.
  • The configured and retrieved KUPL_HBW_POLICY_BIND indicates that the current policy is to allocate memory from the nearest NUMA OPM node. If the OPM memory is insufficient, the allocation will fail, returning nullptr and reporting an error.