Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205438
b: refs/heads/master
c: 68c38fc
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg authored and Ingo Molnar committed Jul 17, 2010
1 parent 05221bb commit b9c56d3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 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: bbc8cb5baead9607309583b20873ab0cc8d89eaf
refs/heads/master: 68c38fc3cb4e5a60f502ee9c45f3dfe70e5165ad
19 changes: 7 additions & 12 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6248,23 +6248,18 @@ static void rq_attach_root(struct rq *rq, struct root_domain *rd)
free_rootdomain(old_rd);
}

static int init_rootdomain(struct root_domain *rd, bool bootmem)
static int init_rootdomain(struct root_domain *rd)
{
gfp_t gfp = GFP_KERNEL;

memset(rd, 0, sizeof(*rd));

if (bootmem)
gfp = GFP_NOWAIT;

if (!alloc_cpumask_var(&rd->span, gfp))
if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
goto out;
if (!alloc_cpumask_var(&rd->online, gfp))
if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
goto free_span;
if (!alloc_cpumask_var(&rd->rto_mask, gfp))
if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
goto free_online;

if (cpupri_init(&rd->cpupri, bootmem) != 0)
if (cpupri_init(&rd->cpupri) != 0)
goto free_rto_mask;
return 0;

Expand All @@ -6280,7 +6275,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)

static void init_defrootdomain(void)
{
init_rootdomain(&def_root_domain, true);
init_rootdomain(&def_root_domain);

atomic_set(&def_root_domain.refcount, 1);
}
Expand All @@ -6293,7 +6288,7 @@ static struct root_domain *alloc_rootdomain(void)
if (!rd)
return NULL;

if (init_rootdomain(rd, false) != 0) {
if (init_rootdomain(rd) != 0) {
kfree(rd);
return NULL;
}
Expand Down
8 changes: 2 additions & 6 deletions trunk/kernel/sched_cpupri.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,18 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri)
*
* Returns: -ENOMEM if memory fails.
*/
int cpupri_init(struct cpupri *cp, bool bootmem)
int cpupri_init(struct cpupri *cp)
{
gfp_t gfp = GFP_KERNEL;
int i;

if (bootmem)
gfp = GFP_NOWAIT;

memset(cp, 0, sizeof(*cp));

for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) {
struct cpupri_vec *vec = &cp->pri_to_cpu[i];

raw_spin_lock_init(&vec->lock);
vec->count = 0;
if (!zalloc_cpumask_var(&vec->mask, gfp))
if (!zalloc_cpumask_var(&vec->mask, GFP_KERNEL))
goto cleanup;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/sched_cpupri.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct cpupri {
int cpupri_find(struct cpupri *cp,
struct task_struct *p, struct cpumask *lowest_mask);
void cpupri_set(struct cpupri *cp, int cpu, int pri);
int cpupri_init(struct cpupri *cp, bool bootmem);
int cpupri_init(struct cpupri *cp);
void cpupri_cleanup(struct cpupri *cp);
#else
#define cpupri_set(cp, cpu, pri) do { } while (0)
Expand Down

0 comments on commit b9c56d3

Please sign in to comment.