All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED()
Date: Mon, 15 Nov 2010 10:06:06 +0000	[thread overview]
Message-ID: <20101115100606.GC24194@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <201011151044.36213.arnd@arndb.de>

On Mon, Nov 15, 2010 at 10:44:36AM +0100, Arnd Bergmann wrote:
> On Monday 15 November 2010 10:24:04 Russell King - ARM Linux wrote:
> > 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.

Or do one of the things I've suggested - one of which I've just completed
the code changes for, and results in this lock going away completely.
It's not a nice idea to have percpu data written to by 'foreign' CPUs.

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Atul Sowani <sowani@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, alan@linux.intel.com,
	ralf@linux-mips.org
Subject: Re: [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED()
Date: Mon, 15 Nov 2010 10:06:06 +0000	[thread overview]
Message-ID: <20101115100606.GC24194@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <201011151044.36213.arnd@arndb.de>

On Mon, Nov 15, 2010 at 10:44:36AM +0100, Arnd Bergmann wrote:
> On Monday 15 November 2010 10:24:04 Russell King - ARM Linux wrote:
> > 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.

Or do one of the things I've suggested - one of which I've just completed
the code changes for, and results in this lock going away completely.
It's not a nice idea to have percpu data written to by 'foreign' CPUs.

  reply	other threads:[~2010-11-15 10:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-13 18:31 [PATCH 2.6.36 1/1 RESEND] kernel SPIN_LOCK_UNLOCKED changed to __SPIN_LOCK_UNLOCKED() Atul Sowani
2010-11-13 18:31 ` Atul Sowani
2010-11-15  8:54 ` Uwe Kleine-König
2010-11-15  8:54   ` Uwe Kleine-König
2010-11-15  9:24 ` Russell King - ARM Linux
2010-11-15  9:24   ` Russell King - ARM Linux
2010-11-15  9:44   ` Arnd Bergmann
2010-11-15  9:44     ` Arnd Bergmann
2010-11-15 10:06     ` Russell King - ARM Linux [this message]
2010-11-15 10:06       ` Russell King - ARM Linux
  -- strict thread matches above, loose matches on Subject: below --
2010-11-15 14:46 Atul Sowani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101115100606.GC24194@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.