lkml.org 
[lkml]   [2008]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: missing locking in sched_domains code

* Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> /* doms_cur_mutex serializes access to doms_cur[] array */
> static DEFINE_MUTEX(doms_cur_mutex);
>
> +static inline void lock_doms_cur(void)
> +{
> + mutex_lock(&doms_cur_mutex);
> +}

> @@ -7813,8 +7811,10 @@ int arch_reinit_sched_domains(void)
> int err;
>
> get_online_cpus();
> + lock_doms_cur();

thanks, that looks a lot more clean already. May i ask for another
thing, if you are hacking on this anyway? Please get rid of the
lock_doms_cur() complication now that it's not conditional - an open
coded mutex_lock(&sched_doms_mutex) looks more readable - it gives a
clear idea about what's happening. Also, please rename sched_doms_mutex
to something less tongue-twisting - such as sched_domains_mutex. Hm?

Ingo


\
 
 \ /
  Last update: 2008-04-28 10:35    [W:0.622 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site