login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
19
Re: [PATCH] synchronize_irq needs a barrier
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Nick Piggin <nickpiggin@...>
To: Herbert Xu <herbert@...>
Cc: <torvalds@...>, <benh@...>, <akpm@...>, <linux-kernel@...>, <linuxppc-dev@...>, <mingo@...>, <tglx@...>
Subject:
Re: [PATCH] synchronize_irq needs a barrier
Date: Friday, October 19, 2007 - 12:49 am
On Friday 19 October 2007 13:28, Herbert Xu wrote:
quoted text
> Nick Piggin <nickpiggin@yahoo.com.au> wrote: > >> First of all let's agree on some basic assumptions: > >> > >> * A pair of spin lock/unlock subsumes the effect of a full mb. > > > > Not unless you mean a pair of spin lock/unlock as in > > 2 spin lock/unlock pairs (4 operations). > > > > *X = 10; > > spin_lock(&lock); > > /* *Y speculatively loaded here */ > > /* store to *X leaves CPU store queue here */ > > spin_unlock(&lock); > > y = *Y; > > Good point. > > Although in this case we're still safe because in the worst > cases: > > CPU0 CPU1 > irq_sync = 1 > synchronize_irq > spin lock > load IRQ_INPROGRESS > irq_sync sync is visible > spin unlock > spin lock > load irq_sync > while (IRQ_INPROGRESS) > wait > return > set IRQ_INPROGRESS > spin unlock > tg3_msi > ack IRQ > if (irq_sync) > return > spin lock > clear IRQ_INPROGRESS > spin unlock > > ------------------------------------------------------------ > > CPU0 CPU1 > spin lock > load irq_sync > irq_sync = 1 > synchronize_irq > set IRQ_INPROGRESS > spin unlock > spin lock > load IRQ_INPROGRESS > irq_sync sync is visible > spin unlock > while (IRQ_INPROGRESS) > wait > tg3_msi > ack IRQ > if (irq_sync) > return > do work > spin lock > clear IRQ_INPROGRESS > spin unlock > return > > So because we're using the same lock on both sides, it does > do the right thing even without the memory barrier.
Yeah, if you've got the lock on both sides there, then I agree it will be correct. -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Wed Oct 17, 9:25 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Maxim Levitsky
, (Fri Oct 19, 10:02 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 11:56 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Maxim Levitsky
, (Sat Oct 20, 12:24 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 1:04 am)
Re: [PATCH] synchronize_irq needs a barrier
, Maxim Levitsky
, (Sat Oct 20, 1:36 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 1:46 am)
Re: [PATCH] synchronize_irq needs a barrier
, Maxim Levitsky
, (Sat Oct 20, 2:06 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 2:13 am)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Fri Oct 19, 11:37 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Fri Oct 19, 10:25 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 12:04 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 12:09 am)
Re: [PATCH] synchronize_irq needs a barrier
, Maxim Levitsky
, (Fri Oct 19, 11:10 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sat Oct 20, 12:06 am)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Wed Oct 17, 10:12 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Wed Oct 17, 10:40 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Thu Oct 18, 10:35 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Thu Oct 18, 5:35 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Wed Oct 17, 10:57 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Thu Oct 18, 10:56 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Thu Oct 18, 6:05 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Thu Oct 18, 6:52 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Thu Oct 18, 7:17 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Thu Oct 18, 7:39 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Thu Oct 18, 10:32 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Thu Oct 18, 10:55 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Linus Torvalds
, (Thu Oct 18, 11:26 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Fri Oct 19, 12:20 am)
[NET]: Fix possible dev_deactivate race condition
, Herbert Xu
, (Fri Oct 19, 1:36 am)
Re: [NET]: Fix possible dev_deactivate race condition
, Peter Zijlstra
, (Fri Oct 19, 3:35 am)
Re: [NET]: Fix possible dev_deactivate race condition
, Herbert Xu
, (Fri Oct 19, 5:29 am)
Re: [NET]: Fix possible dev_deactivate race condition
, David Miller
, (Fri Oct 19, 1:38 am)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Fri Oct 19, 12:48 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 12:58 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Sun Oct 21, 5:10 pm)
[IRQ]: Fix synchronize_irq races with IRQ handler
, Herbert Xu
, (Mon Oct 22, 11:26 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 12:35 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 12:29 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 12:11 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Fri Oct 19, 12:26 am)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Fri Oct 19, 1:53 am)
Re: [PATCH] synchronize_irq needs a barrier
, Nick Piggin
, (Thu Oct 18, 10:52 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Herbert Xu
, (Thu Oct 18, 11:28 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Nick Piggin
, (Fri Oct 19, 12:49 am)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Thu Oct 18, 7:52 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Andrew Morton
, (Wed Oct 17, 9:45 pm)
Re: [PATCH] synchronize_irq needs a barrier
, Benjamin Herrenschmidt
, (Wed Oct 17, 9:55 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Andy Whitcroft
clam
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
David Miller
Re: Slow DOWN, please!!!
git
:
linux-netdev
:
Arjan van de Ven
Re: [GIT]: Networking
Lennert Buytenhek
[PATCH 08/39] mv643xx_eth: nuke port status register bit defines
Jarek Poplawski
Re: HTB accuracy for high speed
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
852 guests
online.
Online users
alfombrativa
Syndicate