[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080501200858.GA12246@Krystal>
Date: Thu, 1 May 2008 16:08:59 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>, Luca Tettamanti <kronos.it@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix SMP alternatives : use mutex instead of spinlock,
text_poke is sleepable
* Linus Torvalds (torvalds@...ux-foundation.org) wrote:
>
>
> On Thu, 1 May 2008, Mathieu Desnoyers wrote:
> >
> > Yep. I think using a mutex should fix it. There is no reason to use a
> > spinlock rather than a mutex here.
>
> Is there any reason to do any locking what-so-ever?
>
> If this code could possibly race with something else, that sounds like a
> bug in itself, no?
>
> Linus
The smp_alt mutex taken in
alternatives_smp_module_add/alternatives_smp_module_del seems required
because this code will run at module load/free, even in SMP context (not
within stop_machine_run).
As for alternatives_smp_switch, which is called when switching between
UP and SMP, always in UP context, I guess we should assume it could be
executed concurrently wrt the module_load/free, even in UP on a
CONFIG_PREEMPT kernel.
Mathieu
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists