@@ -115,6 +115,20 @@ func initDefaultNumaConfig(config0 *config.Config) error {
115
115
return nil
116
116
}
117
117
118
+ nodesPhys , err := numa .GetNodesPhys ()
119
+ if err != nil {
120
+ return err
121
+ }
122
+ l0 := len (nodesPhys [0 ].Cores [0 ].ThreadSiblings )
123
+ if l0 == 0 {
124
+ // no thread siblings, no hyper-threading
125
+ return initDefaultLogicalPoolConfig (config0 )
126
+ }
127
+
128
+ return initDefaultPhysPoolConfig (config0 )
129
+ }
130
+
131
+ func initDefaultPhysPoolConfig (config0 * config.Config ) error {
118
132
nodesPhys , err := numa .GetNodesPhys ()
119
133
if err != nil {
120
134
return err
@@ -156,6 +170,48 @@ func initDefaultNumaConfig(config0 *config.Config) error {
156
170
return nil
157
171
}
158
172
173
+ func initDefaultLogicalPoolConfig (config0 * config.Config ) error {
174
+ nodes , err := numa .GetNodes ()
175
+ if err != nil {
176
+ return err
177
+ }
178
+
179
+ node0 := nodes [0 ]
180
+
181
+ numaNodesCount := len (nodes )
182
+ numaCoresCount := len (node0 .Cpus )
183
+ coresCount := getIdleCoresCountDefault (numaNodesCount , numaCoresCount )
184
+
185
+ idleCores := make ([]int , 0 , coresCount )
186
+ for i := 0 ; i < coresCount ; i ++ {
187
+ id := node0 .Cpus [i ]
188
+ idleCores = append (idleCores , id )
189
+ }
190
+
191
+ l1 := (numaNodesCount - 1 )* numaCoresCount + numaCoresCount - coresCount
192
+ loadCores := make ([]int , 0 , l1 )
193
+
194
+ for i := coresCount ; i < numaCoresCount ; i ++ {
195
+ id := node0 .Cpus [i ]
196
+ loadCores = append (loadCores , id )
197
+ }
198
+
199
+ for i := 1 ; i < numaNodesCount ; i ++ {
200
+ node := nodes [i ]
201
+ for _ , core := range node .Cpus {
202
+ loadCores = append (loadCores , core )
203
+ }
204
+ }
205
+
206
+ pool := config0 .Service .Pool
207
+ pool .Idle .Values = idleCores
208
+ pool .Load .Values = loadCores
209
+ pool .LoadType = config .Logical
210
+
211
+ config0 .Service .Pool = pool
212
+ return nil
213
+ }
214
+
159
215
func initDefaultFiltersConfig (config0 * config.Config ) error {
160
216
if len (config0 .Service .Filters0 ) != 0 && len (config0 .Service .Filters1 ) != 0 {
161
217
return nil
0 commit comments