Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/topology: Remove sched_domain_shared allocation with sd_data

Now that "sd->shared" assignments are using the sched_domain_shared
objects allocated with s_data, remove the sd_data based allocations.

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://patch.msgid.link/20260312044434.1974-6-kprateek.nayak@amd.com

authored by

K Prateek Nayak and committed by
Peter Zijlstra
10febd39 bb7a5e44

-20
-1
include/linux/sched/topology.h
··· 172 172 173 173 struct sd_data { 174 174 struct sched_domain *__percpu *sd; 175 - struct sched_domain_shared *__percpu *sds; 176 175 struct sched_group *__percpu *sg; 177 176 struct sched_group_capacity *__percpu *sgc; 178 177 };
-19
kernel/sched/topology.c
··· 1609 1609 WARN_ON_ONCE(*per_cpu_ptr(sdd->sd, cpu) != sd); 1610 1610 *per_cpu_ptr(sdd->sd, cpu) = NULL; 1611 1611 1612 - if (atomic_read(&(*per_cpu_ptr(sdd->sds, cpu))->ref)) 1613 - *per_cpu_ptr(sdd->sds, cpu) = NULL; 1614 - 1615 1612 if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref)) 1616 1613 *per_cpu_ptr(sdd->sg, cpu) = NULL; 1617 1614 ··· 2387 2390 if (!sdd->sd) 2388 2391 return -ENOMEM; 2389 2392 2390 - sdd->sds = alloc_percpu(struct sched_domain_shared *); 2391 - if (!sdd->sds) 2392 - return -ENOMEM; 2393 - 2394 2393 sdd->sg = alloc_percpu(struct sched_group *); 2395 2394 if (!sdd->sg) 2396 2395 return -ENOMEM; ··· 2397 2404 2398 2405 for_each_cpu(j, cpu_map) { 2399 2406 struct sched_domain *sd; 2400 - struct sched_domain_shared *sds; 2401 2407 struct sched_group *sg; 2402 2408 struct sched_group_capacity *sgc; 2403 2409 ··· 2406 2414 return -ENOMEM; 2407 2415 2408 2416 *per_cpu_ptr(sdd->sd, j) = sd; 2409 - 2410 - sds = kzalloc_node(sizeof(struct sched_domain_shared), 2411 - GFP_KERNEL, cpu_to_node(j)); 2412 - if (!sds) 2413 - return -ENOMEM; 2414 - 2415 - *per_cpu_ptr(sdd->sds, j) = sds; 2416 2417 2417 2418 sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(), 2418 2419 GFP_KERNEL, cpu_to_node(j)); ··· 2448 2463 kfree(*per_cpu_ptr(sdd->sd, j)); 2449 2464 } 2450 2465 2451 - if (sdd->sds) 2452 - kfree(*per_cpu_ptr(sdd->sds, j)); 2453 2466 if (sdd->sg) 2454 2467 kfree(*per_cpu_ptr(sdd->sg, j)); 2455 2468 if (sdd->sgc) ··· 2455 2472 } 2456 2473 free_percpu(sdd->sd); 2457 2474 sdd->sd = NULL; 2458 - free_percpu(sdd->sds); 2459 - sdd->sds = NULL; 2460 2475 free_percpu(sdd->sg); 2461 2476 sdd->sg = NULL; 2462 2477 free_percpu(sdd->sgc);