Re: [PATCH] sched: missing locking in sched_domains code

From: Ingo Molnar
Date: Mon Apr 28 2008 - 03:25:30 EST



* Heiko Carstens <heiko.carstens@xxxxxxxxxx> wrote:

>
> /*
> + * Protects against concurrent calls to detach_destroy_domains
> + * and arch_init_sched_domains.
> + */
> +static DEFINE_MUTEX(sched_domains_mutex);
> +
> +/*
> * Partition sched domains as specified by the 'ndoms_new'
> * cpumasks in the array doms_new[] of cpumasks. This compares
> * doms_new[] to the current sched domain partitioning, doms_cur[].
> @@ -7756,7 +7762,8 @@ void partition_sched_domains(int ndoms_n
> int i, j;
>
> lock_doms_cur();
> -
> + mutex_lock(&sched_domains_mutex);

i might be missing something but why not make doms_cur_mutex locking
unconditional and extend it to detach_destroy_domains() as well?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/