lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED()
Date
On Monday 15 November 2010 10:24:04 Russell King - ARM Linux wrote:
> > diff -uprN a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> > --- a/arch/arm/kernel/smp.c 2010-10-21 02:00:22.000000000 +0530
> > +++ b/arch/arm/kernel/smp.c 2010-11-07 00:47:32.000000000 +0530
> > @@ -56,7 +56,7 @@ struct ipi_data {
> > };
> >
> > static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
> > - .lock = SPIN_LOCK_UNLOCKED,
> > + .lock = __SPIN_LOCK_UNLOCKED(ipi_data.lock),
> > };
>
> This lock is in the percpu data area. This means that when other CPUs
> are brought online, and therefore other percpu areas are instantiated,
> this lock will be mis-initialized (the pointers et.al. will be pointing
> at the original percpu instance.)
>
> So NAK, this will break.

I believe right now we only use the argument of __SPIN_LOCK_UNLOCKED
as an identifier string for lockdep, but not for any pointers, so the
patch would actually do what was intended, but break if we ever start
relying on the pointer.

Maybe we can mangle the argument in some way to make sure it will break
at build time when that happens, e.g.

.lock = __SPIN_LOCK_UNLOCKED(ipi_data.__lock)

This would at least let us remove SPIN_LOCK_UNLOCKED.

Arnd


\
 
 \ /
  Last update: 2010-11-15 10:47    [W:0.029 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site