Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76116
b: refs/heads/master
c: a183561
h: refs/heads/master
v: v3
  • Loading branch information
Srivatsa Vaddagiri authored and Ingo Molnar committed Jan 25, 2008
1 parent 4cfdeb4 commit ece13bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58e2d4ca581167c2a079f4ee02be2f0bc52e8729
refs/heads/master: a183561567b5446d3362b4839bd4f744f4b2af1e
19 changes: 19 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ static struct cfs_rq *init_cfs_rq_p[NR_CPUS];
*/
static DEFINE_MUTEX(task_group_mutex);

/* doms_cur_mutex serializes access to doms_cur[] array */
static DEFINE_MUTEX(doms_cur_mutex);

/* Default task group.
* Every task in system belong to this group at bootup.
*/
Expand Down Expand Up @@ -234,11 +237,23 @@ static inline void unlock_task_group_list(void)
mutex_unlock(&task_group_mutex);
}

static inline void lock_doms_cur(void)
{
mutex_lock(&doms_cur_mutex);
}

static inline void unlock_doms_cur(void)
{
mutex_unlock(&doms_cur_mutex);
}

#else

static inline void set_task_cfs_rq(struct task_struct *p, unsigned int cpu) { }
static inline void lock_task_group_list(void) { }
static inline void unlock_task_group_list(void) { }
static inline void lock_doms_cur(void) { }
static inline void unlock_doms_cur(void) { }

#endif /* CONFIG_FAIR_GROUP_SCHED */

Expand Down Expand Up @@ -6543,6 +6558,8 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new)
{
int i, j;

lock_doms_cur();

/* always unregister in case we don't destroy any domains */
unregister_sched_domain_sysctl();

Expand Down Expand Up @@ -6583,6 +6600,8 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new)
ndoms_cur = ndoms_new;

register_sched_domain_sysctl();

unlock_doms_cur();
}

#if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
Expand Down

0 comments on commit ece13bf

Please sign in to comment.