[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200808221137.50509.nickpiggin@yahoo.com.au>
Date: Fri, 22 Aug 2008 11:37:50 +1000
From: Nick Piggin <nickpiggin@...oo.com.au>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: jmerkey@...fmountaingroup.com,
Stefan Richter <stefanr@...6.in-berlin.de>,
paulmck@...ux.vnet.ibm.com, Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
David Howells <dhowells@...hat.com>
Subject: Re: [ANNOUNCE] mdb: Merkey's Linux Kernel Debugger 2.6.27-rc4 released
On Friday 22 August 2008 07:06, Jeremy Fitzhardinge wrote:
> Nick Piggin wrote:
> > On Thursday 21 August 2008 22:26, jmerkey@...fmountaingroup.com wrote:
> >> I used the smp_wmb() functions. I noted a couple of things. a) some of
> >> these macros just emit __asm__ __volatile__ into the code so why not
> >> just say "volatile" to begin with
> >
> > It is not the same as volatile type. What it does is tell the compiler
> > to clobber all registers or temporaries. This something pretty well
> > defined and hard to get wrong compared to volatile type.
>
> No, that's not what "asm volatile" means. Its *only* meaning is "emit
> this, even if it doesn't look like it has side-effects and its results
> are not used". An asm() with no outputs is "volatile" by default, which
> makes most of the uses of "asm volatile" in the kernel redundant. "asm
> volatile" also has no effect on the ordering of the asm with respect to
> other code; you must use constraints to do that.
>
> An asm with a "memory" clobber is sufficient to make sure that gcc
> doesn't cache memory values in registers; perhaps that's what you mean.
That is what I meant, yes.
--
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