Skip to content

Commit bf28b25

Browse files
Peter ZijlstraIngo Molnar
Peter Zijlstra
authored and
Ingo Molnar
committed
sched: Remove nodemask allocation
There's only one nodemask user left so remove it with a direct computation and save some memory and reduce some code-flow complexity. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Nick Piggin <npiggin@kernel.dk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20110407122942.505608966@chello.nl Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 3bd65a8 commit bf28b25

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

kernel/sched.c

+3-11
Original file line numberDiff line numberDiff line change
@@ -6838,7 +6838,6 @@ struct sd_data {
68386838
};
68396839

68406840
struct s_data {
6841-
cpumask_var_t nodemask;
68426841
cpumask_var_t send_covered;
68436842
struct sched_domain ** __percpu sd;
68446843
struct sd_data sdd[SD_LV_MAX];
@@ -6850,7 +6849,6 @@ enum s_alloc {
68506849
sa_sd,
68516850
sa_sd_storage,
68526851
sa_send_covered,
6853-
sa_nodemask,
68546852
sa_none,
68556853
};
68566854

@@ -7035,8 +7033,6 @@ static void __free_domain_allocs(struct s_data *d, enum s_alloc what,
70357033
} /* fall through */
70367034
case sa_send_covered:
70377035
free_cpumask_var(d->send_covered); /* fall through */
7038-
case sa_nodemask:
7039-
free_cpumask_var(d->nodemask); /* fall through */
70407036
case sa_none:
70417037
break;
70427038
}
@@ -7049,10 +7045,8 @@ static enum s_alloc __visit_domain_allocation_hell(struct s_data *d,
70497045

70507046
memset(d, 0, sizeof(*d));
70517047

7052-
if (!alloc_cpumask_var(&d->nodemask, GFP_KERNEL))
7053-
return sa_none;
70547048
if (!alloc_cpumask_var(&d->send_covered, GFP_KERNEL))
7055-
return sa_nodemask;
7049+
return sa_none;
70567050
for (i = 0; i < SD_LV_MAX; i++) {
70577051
d->sdd[i].sd = alloc_percpu(struct sched_domain *);
70587052
if (!d->sdd[i].sd)
@@ -7149,7 +7143,8 @@ static struct sched_domain *__build_cpu_sched_domain(struct s_data *d,
71497143
struct sched_domain *sd;
71507144
sd = sd_init_CPU(d, i);
71517145
set_domain_attribute(sd, attr);
7152-
cpumask_copy(sched_domain_span(sd), d->nodemask);
7146+
cpumask_and(sched_domain_span(sd),
7147+
cpumask_of_node(cpu_to_node(i)), cpu_map);
71537148
sd->parent = parent;
71547149
if (parent)
71557150
parent->child = sd;
@@ -7219,9 +7214,6 @@ static int build_sched_domains(const struct cpumask *cpu_map,
72197214

72207215
/* Set up domains for cpus specified by the cpu_map. */
72217216
for_each_cpu(i, cpu_map) {
7222-
cpumask_and(d.nodemask, cpumask_of_node(cpu_to_node(i)),
7223-
cpu_map);
7224-
72257217
sd = NULL;
72267218
sd = __build_allnodes_sched_domain(&d, cpu_map, attr, sd, i);
72277219
sd = __build_node_sched_domain(&d, cpu_map, attr, sd, i);

0 commit comments

Comments
 (0)