@@ -57,12 +57,26 @@ typedef enum umf_numa_mode_t {
57
57
/// fulfilled, memory will be allocated from other nodes.
58
58
UMF_NUMA_MODE_PREFERRED ,
59
59
60
+ /// Allocation will be split evenly across nodes specified in nodemask.
61
+ /// umf_numa_split_partition_t can be passed in umf_os_memory_provider_params_t structure
62
+ /// to specify other distribution.
63
+ UMF_NUMA_MODE_SPLIT ,
60
64
/// The memory is allocated on the node of the CPU that triggered the
61
65
/// allocation. If this mode is specified, nodemask must be NULL and
62
66
/// maxnode must be 0.
63
67
UMF_NUMA_MODE_LOCAL , // TODO: should this be a hint or strict policy?
64
68
} umf_numa_mode_t ;
65
69
70
+ /// @brief This structure specifies a user-defined page distribution
71
+ /// within a single allocation in UMF_NUMA_MODE_SPLIT mode.
72
+ typedef struct umf_numa_split_partition_t {
73
+ /// The weight of the partition, representing the proportion of
74
+ /// the allocation that should be assigned to this NUMA node.
75
+ unsigned weight ;
76
+ /// The NUMA node where the pages assigned to this partition will be bound.
77
+ unsigned target ;
78
+ } umf_numa_split_partition_t ;
79
+
66
80
/// @brief Memory provider settings struct
67
81
typedef struct umf_os_memory_provider_params_t {
68
82
/// Combination of 'umf_mem_protection_flags_t' flags
@@ -81,6 +95,11 @@ typedef struct umf_os_memory_provider_params_t {
81
95
/// part size for interleave mode - 0 means default (system specific)
82
96
/// It might be rounded up because of HW constraints
83
97
size_t part_size ;
98
+
99
+ /// ordered list of the partitions for split mode
100
+ umf_numa_split_partition_t * partitions ;
101
+ /// len of partitions array
102
+ unsigned partitions_len ;
84
103
} umf_os_memory_provider_params_t ;
85
104
86
105
/// @brief OS Memory Provider operation results
@@ -106,8 +125,9 @@ umfOsMemoryProviderParamsDefault(void) {
106
125
NULL , /* numa_list */
107
126
0 , /* numa_list_len */
108
127
UMF_NUMA_MODE_DEFAULT , /* numa_mode */
109
- 0 /* part_size */
110
- };
128
+ 0 , /* part_size */
129
+ NULL , /* partitions */
130
+ 0 }; /* partitions_len*/
111
131
112
132
return params ;
113
133
}
0 commit comments