linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] __cmpxchg() must really always be inlined on alpha
@ 2006-02-02 13:21 Steve Langasek
  0 siblings, 0 replies; only message in thread
From: Steve Langasek @ 2006-02-02 13:21 UTC (permalink / raw)
  To: linux-alpha, stable; +Cc: nobse


[-- Attachment #1.1: Type: text/plain, Size: 1143 bytes --]

Hi folks,

With the latest 2.6.15 kernel builds for alpha on Debian, we ran into a
problem with undefined references to __cmpxchg_called_with_bad_pointer() in
a couple of kernel modules (xfs.ko and drm.ko; see
http://bugs.debian.org/347556).  It looks like people have been trying to
out-clever each other wrt the definition of "inline" on this architecture
:), with the result that __cmpxchg(), which must be inlined so the compiler
can see its argument is const, is not guaranteed to be inlined.  Indeed, it
was not being inlined when building with -Os.

I was asked to forward the attached patch to these two lists, which fixes
the issue by adding an __attribute__((always_inline)) explicitly to the
definition of __cmpxchg() instead of relying on redefines of "inline"
elsewhere to make this happen.  Please let me know if I should be submitting
the patch in a different format.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/

[-- Attachment #1.2: alpha-cmpxchg-inline.patch --]
[-- Type: text/plain, Size: 496 bytes --]

--- linux-2.6.15/include/asm-alpha/system.h.orig	2006-01-26 02:57:09.000000000 -0800
+++ linux-2.6.15/include/asm-alpha/system.h	2006-01-26 02:58:13.000000000 -0800
@@ -562,7 +562,7 @@
    if something tries to do an invalid cmpxchg().  */
 extern void __cmpxchg_called_with_bad_pointer(void);
 
-static inline unsigned long
+static inline __attribute__((always_inline)) unsigned long
 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 {
 	switch (size) {

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-02 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 13:21 [patch] __cmpxchg() must really always be inlined on alpha Steve Langasek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).