File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1884,6 +1884,7 @@ struct sched_group {
1884
1884
atomic_t ref ;
1885
1885
1886
1886
unsigned int group_weight ;
1887
+ unsigned int cores ;
1887
1888
struct sched_group_capacity * sgc ;
1888
1889
int asym_prefer_cpu ; /* CPU of highest priority in group */
1889
1890
int flags ;
Original file line number Diff line number Diff line change @@ -1275,14 +1275,24 @@ build_sched_groups(struct sched_domain *sd, int cpu)
1275
1275
static void init_sched_groups_capacity (int cpu , struct sched_domain * sd )
1276
1276
{
1277
1277
struct sched_group * sg = sd -> groups ;
1278
+ struct cpumask * mask = sched_domains_tmpmask2 ;
1278
1279
1279
1280
WARN_ON (!sg );
1280
1281
1281
1282
do {
1282
- int cpu , max_cpu = -1 ;
1283
+ int cpu , cores = 0 , max_cpu = -1 ;
1283
1284
1284
1285
sg -> group_weight = cpumask_weight (sched_group_span (sg ));
1285
1286
1287
+ cpumask_copy (mask , sched_group_span (sg ));
1288
+ for_each_cpu (cpu , mask ) {
1289
+ cores ++ ;
1290
+ #ifdef CONFIG_SCHED_SMT
1291
+ cpumask_andnot (mask , mask , cpu_smt_mask (cpu ));
1292
+ #endif
1293
+ }
1294
+ sg -> cores = cores ;
1295
+
1286
1296
if (!(sd -> flags & SD_ASYM_PACKING ))
1287
1297
goto next ;
1288
1298
You can’t perform that action at this time.
0 commit comments