Re: [PATCH 4/5] kgdb: Use atomic operators which use barriers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jason Wessel
Date: Friday, April 2, 2010 - 12:37 pm

On 04/02/2010 02:12 PM, Linus Torvalds wrote:

So this part might be overkill, but I don't actually have the hardware,
schematics or reference manuals to ascertain what is going on.  The
other changes in this patch should be correct because we really do want
memory barriers which come along with the inc and dec operators.


Will originally proposed a patch for cpu_relax:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-March/011076.html
--- The patch ---

+#if __LINUX_ARM_ARCH__ == 6
+#define cpu_relax()			smp_mb()
+#else
 #define cpu_relax()			barrier()
+#endif

---

Russell had this thread: 
http://permalink.gmane.org/gmane.linux.ports.arm.kernel/75717

--- clip from url ---

cpu_relax() is also defined to be a compiler barrier so that the compiler
reloads the variable on every iteration.


I don't think this is correct.  You're making a macro do something on ARM
which no other platform, apart from blackfin (which I believe is wrong)
makes it do.

---


Given your statements, I can just keep the atomic reads as they were
previously, but keep the inc and dec parts.  And we can wait for a
further response from either Will or Russell.

Thanks,
Jason.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 4/5] kgdb: Use atomic operators which use barriers, Jason Wessel, (Fri Apr 2, 12:37 pm)
Re: [PATCH 4/5] kgdb: Use atomic operators which use barriers, Russell King - ARM Linux, (Fri Apr 2, 3:25 pm)
Re: [PATCH 4/5] kgdb: Use atomic operators which use barriers, Russell King - ARM Linux, (Sat Apr 3, 9:08 am)