Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121323
b: refs/heads/master
c: 6d21cd6
h: refs/heads/master
i:
  121321: 46f767e
  121319: 56478b6
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Nov 7, 2008
1 parent faacd1c commit aea3b71
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 258594a138f4ca9adf214f5272592d7f21def610
refs/heads/master: 6d21cd62516a9697cb7ec33cc52e6b814fb65a13
29 changes: 18 additions & 11 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -7279,13 +7279,21 @@ struct allmasks {
};

#if NR_CPUS > 128
#define SCHED_CPUMASK_ALLOC 1
#define SCHED_CPUMASK_FREE(v) kfree(v)
#define SCHED_CPUMASK_DECLARE(v) struct allmasks *v
#define SCHED_CPUMASK_DECLARE(v) struct allmasks *v
static inline void sched_cpumask_alloc(struct allmasks **masks)
{
*masks = kmalloc(sizeof(**masks), GFP_KERNEL);
}
static inline void sched_cpumask_free(struct allmasks *masks)
{
kfree(masks);
}
#else
#define SCHED_CPUMASK_ALLOC 0
#define SCHED_CPUMASK_FREE(v)
#define SCHED_CPUMASK_DECLARE(v) struct allmasks _v, *v = &_v
#define SCHED_CPUMASK_DECLARE(v) struct allmasks _v, *v = &_v
static inline void sched_cpumask_alloc(struct allmasks **masks)
{ }
static inline void sched_cpumask_free(struct allmasks *masks)
{ }
#endif

#define SCHED_CPUMASK_VAR(v, a) cpumask_t *v = (cpumask_t *) \
Expand Down Expand Up @@ -7361,9 +7369,8 @@ static int __build_sched_domains(const cpumask_t *cpu_map,
return -ENOMEM;
}

#if SCHED_CPUMASK_ALLOC
/* get space for all scratch cpumask variables */
allmasks = kmalloc(sizeof(*allmasks), GFP_KERNEL);
sched_cpumask_alloc(&allmasks);
if (!allmasks) {
printk(KERN_WARNING "Cannot alloc cpumask array\n");
kfree(rd);
Expand All @@ -7372,7 +7379,7 @@ static int __build_sched_domains(const cpumask_t *cpu_map,
#endif
return -ENOMEM;
}
#endif

tmpmask = (cpumask_t *)allmasks;


Expand Down Expand Up @@ -7626,13 +7633,13 @@ static int __build_sched_domains(const cpumask_t *cpu_map,
cpu_attach_domain(sd, rd, i);
}

SCHED_CPUMASK_FREE((void *)allmasks);
sched_cpumask_free(allmasks);
return 0;

#ifdef CONFIG_NUMA
error:
free_sched_groups(cpu_map, tmpmask);
SCHED_CPUMASK_FREE((void *)allmasks);
sched_cpumask_free(allmasks);
kfree(rd);
return -ENOMEM;
#endif
Expand Down

0 comments on commit aea3b71

Please sign in to comment.