]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/topology: Remove sched_domain_shared allocation with sd_data
authorK Prateek Nayak <kprateek.nayak@amd.com>
Thu, 12 Mar 2026 04:44:30 +0000 (04:44 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 18 Mar 2026 08:06:49 +0000 (09:06 +0100)
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
include/linux/sched/topology.h
kernel/sched/topology.c

index a1e1032426dcc0426cf5308218892e930f2758c9..51c29581f15ebf25d9fddea5cb7706d88de66e0e 100644 (file)
@@ -172,7 +172,6 @@ typedef int (*sched_domain_flags_f)(void);
 
 struct sd_data {
        struct sched_domain *__percpu *sd;
-       struct sched_domain_shared *__percpu *sds;
        struct sched_group *__percpu *sg;
        struct sched_group_capacity *__percpu *sgc;
 };
index b19d84f4466948113b17e0d36c7f1b7df91fba0d..43150591914bdf5856517a5956faa9cf3a4956f4 100644 (file)
@@ -1609,9 +1609,6 @@ static void claim_allocations(int cpu, struct s_data *d)
                WARN_ON_ONCE(*per_cpu_ptr(sdd->sd, cpu) != sd);
                *per_cpu_ptr(sdd->sd, cpu) = NULL;
 
-               if (atomic_read(&(*per_cpu_ptr(sdd->sds, cpu))->ref))
-                       *per_cpu_ptr(sdd->sds, cpu) = NULL;
-
                if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref))
                        *per_cpu_ptr(sdd->sg, cpu) = NULL;
 
@@ -2390,10 +2387,6 @@ static int __sdt_alloc(const struct cpumask *cpu_map)
                if (!sdd->sd)
                        return -ENOMEM;
 
-               sdd->sds = alloc_percpu(struct sched_domain_shared *);
-               if (!sdd->sds)
-                       return -ENOMEM;
-
                sdd->sg = alloc_percpu(struct sched_group *);
                if (!sdd->sg)
                        return -ENOMEM;
@@ -2404,7 +2397,6 @@ static int __sdt_alloc(const struct cpumask *cpu_map)
 
                for_each_cpu(j, cpu_map) {
                        struct sched_domain *sd;
-                       struct sched_domain_shared *sds;
                        struct sched_group *sg;
                        struct sched_group_capacity *sgc;
 
@@ -2415,13 +2407,6 @@ static int __sdt_alloc(const struct cpumask *cpu_map)
 
                        *per_cpu_ptr(sdd->sd, j) = sd;
 
-                       sds = kzalloc_node(sizeof(struct sched_domain_shared),
-                                       GFP_KERNEL, cpu_to_node(j));
-                       if (!sds)
-                               return -ENOMEM;
-
-                       *per_cpu_ptr(sdd->sds, j) = sds;
-
                        sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(),
                                        GFP_KERNEL, cpu_to_node(j));
                        if (!sg)
@@ -2463,8 +2448,6 @@ static void __sdt_free(const struct cpumask *cpu_map)
                                kfree(*per_cpu_ptr(sdd->sd, j));
                        }
 
-                       if (sdd->sds)
-                               kfree(*per_cpu_ptr(sdd->sds, j));
                        if (sdd->sg)
                                kfree(*per_cpu_ptr(sdd->sg, j));
                        if (sdd->sgc)
@@ -2472,8 +2455,6 @@ static void __sdt_free(const struct cpumask *cpu_map)
                }
                free_percpu(sdd->sd);
                sdd->sd = NULL;
-               free_percpu(sdd->sds);
-               sdd->sds = NULL;
                free_percpu(sdd->sg);
                sdd->sg = NULL;
                free_percpu(sdd->sgc);