Commit d5dd3db1 authored by Rusty Russell's avatar Rusty Russell Committed by Ingo Molnar

sched: convert sched_domain_debug to cpumask_var_t.

Impact: stack usage reduction

Dynamically allocating cpumasks (when CONFIG_CPUMASK_OFFSTACK) saves
stack space.  cpumask_var_t is just a struct cpumask for
!CONFIG_CPUMASK_OFFSTACK.

In this case, we always alloced, but we don't need to any more.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5a16f3d3
...@@ -6706,7 +6706,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, ...@@ -6706,7 +6706,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
static void sched_domain_debug(struct sched_domain *sd, int cpu) static void sched_domain_debug(struct sched_domain *sd, int cpu)
{ {
cpumask_t *groupmask; cpumask_var_t groupmask;
int level = 0; int level = 0;
if (!sd) { if (!sd) {
...@@ -6716,8 +6716,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu) ...@@ -6716,8 +6716,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
printk(KERN_DEBUG "CPU%d attaching sched-domain:\n", cpu); printk(KERN_DEBUG "CPU%d attaching sched-domain:\n", cpu);
groupmask = kmalloc(sizeof(cpumask_t), GFP_KERNEL); if (!alloc_cpumask_var(&groupmask, GFP_KERNEL)) {
if (!groupmask) {
printk(KERN_DEBUG "Cannot load-balance (out of memory)\n"); printk(KERN_DEBUG "Cannot load-balance (out of memory)\n");
return; return;
} }
...@@ -6730,7 +6729,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu) ...@@ -6730,7 +6729,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
if (!sd) if (!sd)
break; break;
} }
kfree(groupmask); free_cpumask_var(groupmask);
} }
#else /* !CONFIG_SCHED_DEBUG */ #else /* !CONFIG_SCHED_DEBUG */
# define sched_domain_debug(sd, cpu) do { } while (0) # define sched_domain_debug(sd, cpu) do { } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment