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

From: Andrew Morton
Date: Mon Apr 28 2008 - 05:33:38 EST


On Mon, 28 Apr 2008 11:17:45 +0200 Heiko Carstens <heiko.carstens@xxxxxxxxxx> wrote:

> On Mon, Apr 28, 2008 at 01:57:23AM -0700, Andrew Morton wrote:
> > On Mon, 28 Apr 2008 10:49:04 +0200 Heiko Carstens <heiko.carstens@xxxxxxxxxx> wrote:
> > > /* doms_cur_mutex serializes access to doms_cur[] array */
> > > -static DEFINE_MUTEX(doms_cur_mutex);
> > > +static DEFINE_MUTEX(sched_domains_mutex);
> >
> > The comment refers to a no-longer-existing lock, and no longer correctly
> > describes the lock's usage.
>
> version 42. Please feel free to change the comment if you think it could
> be better :)

Actually, it's a pretty bad comment ;)

> +/* sched_domains_mutex serializes calls to arch_init_sched_domains,
> + * detach_destroy_domains and partition_sched_domains.
> + */

locks protect *data*, not "calls". This matters. Which data is actually
protected by this lock??

--
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/