1. 03 7月, 2009 2 次提交
    • I
      x86: atomic64: Move the 32-bit atomic64_t implementation to a .c file · b7882b7c
      Ingo Molnar 提交于
      Linus noted that the atomic64_t primitives are all inlines
      currently which is crazy because these functions have a large
      register footprint anyway.
      
      Move them to a separate file: arch/x86/lib/atomic64_32.c
      
      Also, while at it, rename all uses of 'unsigned long long' to
      the much shorter u64.
      
      This makes the appearance of the prototypes a lot nicer - and
      it also uncovered a few bugs where (yet unused) API variants
      had 'long' as their return type instead of u64.
      
      [ More intrusive changes are not yet done in this patch. ]
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      LKML-Reference: <alpine.LFD.2.01.0907021653030.3210@localhost.localdomain>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b7882b7c
    • E
      x86: atomic64: The atomic64_t data type should be 8 bytes aligned on 32-bit too · bbf2a330
      Eric Dumazet 提交于
      Locked instructions on two cache lines at once are painful. If
      atomic64_t uses two cache lines, my test program is 10x slower.
      
      The chance for that is significant: 4/32 or 12.5%.
      
      Make sure an atomic64_t is 8 bytes aligned.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      LKML-Reference: <alpine.LFD.2.01.0907021653030.3210@localhost.localdomain>
      [ changed it to __aligned(8) as per Andrew's suggestion ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bbf2a330
  2. 14 6月, 2009 1 次提交
    • R
      x86: atomic_32.h: Fix kernel-doc warnings · 46e44328
      Randy Dunlap 提交于
      Fix kernel-doc warnings in atomic_32.h:
      
        Warning(arch/x86/include/asm/atomic_32.h:265): No description found for parameter 'ptr'
        Warning(arch/x86/include/asm/atomic_32.h:265): Excess function parameter 'v' description in '__atomic64_read'
        Warning(arch/x86/include/asm/atomic_32.h:305): Excess function parameter 'old_val' description in 'atomic64_xchg'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      LKML-Reference: <4A3467E6.6010907@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      46e44328
  3. 12 6月, 2009 1 次提交
  4. 07 4月, 2009 1 次提交
  5. 07 1月, 2009 1 次提交
  6. 15 12月, 2008 1 次提交
  7. 23 10月, 2008 2 次提交
  8. 23 7月, 2008 1 次提交
    • V
      x86: consolidate header guards · 77ef50a5
      Vegard Nossum 提交于
      This patch is the result of an automatic script that consolidates the
      format of all the headers in include/asm-x86/.
      
      The format:
      
      1. No leading underscore. Names with leading underscores are reserved.
      2. Pathname components are separated by two underscores. So we can
         distinguish between mm_types.h and mm/types.h.
      3. Everything except letters and numbers are turned into single
         underscores.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      77ef50a5
  9. 17 4月, 2008 1 次提交
  10. 11 10月, 2007 1 次提交
  11. 24 5月, 2007 1 次提交
  12. 09 5月, 2007 4 次提交
  13. 12 2月, 2007 1 次提交
  14. 07 12月, 2006 2 次提交
    • D
      [PATCH] x86-64: fix asm constraints in i386 atomic_add_return · e4b522d7
      Duncan Sands 提交于
      Since v->counter is both read and written, it should be an output as well
      as an input for the asm.  The current code only gets away with this because
      counter is volatile.  Also, according to Documents/atomic_ops.txt,
      atomic_add_return should provide a memory barrier, in particular a compiler
      barrier, so the asm should be marked as clobbering memory.
      
      Test case:
      
      #include <stdio.h>
      
      typedef struct { int counter; } atomic_t; /* NB: no "volatile" */
      
      #define ATOMIC_INIT(i)	{ (i) }
      
      #define atomic_read(v)		((v)->counter)
      
      static __inline__ int atomic_add_return(int i, atomic_t *v)
      {
      	int __i = i;
      
      	__asm__ __volatile__(
      		"lock; xaddl %0, %1;"
      		:"=r"(i)
      		:"m"(v->counter), "0"(i));
      /*	__asm__ __volatile__(
      		"lock; xaddl %0, %1"
      		:"+r" (i), "+m" (v->counter)
      		: : "memory"); */
      	return i + __i;
      }
      
      int main (void) {
      	atomic_t a = ATOMIC_INIT(0);
      	int x;
      
      	x = atomic_add_return (1, &a);
      	if ((x!=1) || (atomic_read(&a)!=1))
      		printf("fail: %i, %i\n", x, atomic_read(&a));
      }
      Signed-off-by: NDuncan Sands <baldrick@free.fr>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: Andi Kleen <ak@suse.de>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      e4b522d7
    • L
      x86[-64]:Remove 'volatile' from atomic_t · f9e9dcb3
      Linus Torvalds 提交于
      Any code that relies on the volatile would be a bug waiting to happen
      anyway.
      
      Don't encourage people to think that putting 'volatile' on data
      structures somehow fixes problems.  We should always use proper locking
      (and other serialization) techniques.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f9e9dcb3
  15. 09 7月, 2006 1 次提交
    • L
      i386: improve and correct inline asm memory constraints · b862f3b0
      Linus Torvalds 提交于
      Use "+m" rather than a combination of "=m" and "m" for improved clarity
      and consistency.
      
      This also fixes some inlines that incorrectly didn't tell the compiler
      that they read the old value at all, potentially causing the compiler to
      generate bogus code.  It appear that all of those potential bugs were
      hidden by the use of extra "volatile" specifiers on the data structures
      in question, though.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b862f3b0
  16. 26 4月, 2006 1 次提交
  17. 20 4月, 2006 1 次提交
  18. 23 3月, 2006 2 次提交
    • N
      [PATCH] atomic: add_unless cmpxchg optimise · 0b2fcfdb
      Nick Piggin 提交于
      Without branch hints, the very unlikely chance of the loop repeating due to
      cmpxchg failure is unrolled with gcc-4 that I have tested.
      
      Improve this for architectures with a native cas/cmpxchg.  llsc archs
      should try to implement this natively.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0b2fcfdb
    • G
      [PATCH] x86: SMP alternatives · 9a0b5817
      Gerd Hoffmann 提交于
      Implement SMP alternatives, i.e.  switching at runtime between different
      code versions for UP and SMP.  The code can patch both SMP->UP and UP->SMP.
      The UP->SMP case is useful for CPU hotplug.
      
      With CONFIG_CPU_HOTPLUG enabled the code switches to UP at boot time and
      when the number of CPUs goes down to 1, and switches to SMP when the number
      of CPUs goes up to 2.
      
      Without CONFIG_CPU_HOTPLUG or on non-SMP-capable systems the code is
      patched once at boot time (if needed) and the tables are released
      afterwards.
      
      The changes in detail:
      
        * The current alternatives bits are moved to a separate file,
          the SMP alternatives code is added there.
      
        * The patch adds some new elf sections to the kernel:
          .smp_altinstructions
      	like .altinstructions, also contains a list
      	of alt_instr structs.
          .smp_altinstr_replacement
      	like .altinstr_replacement, but also has some space to
      	save original instruction before replaving it.
          .smp_locks
      	list of pointers to lock prefixes which can be nop'ed
      	out on UP.
          The first two are used to replace more complex instruction
          sequences such as spinlocks and semaphores.  It would be possible
          to deal with the lock prefixes with that as well, but by handling
          them as special case the table sizes become much smaller.
      
       * The sections are page-aligned and padded up to page size, so they
         can be free if they are not needed.
      
       * Splitted the code to release init pages to a separate function and
         use it to release the elf sections if they are unused.
      Signed-off-by: NGerd Hoffmann <kraxel@suse.de>
      Signed-off-by: NChuck Ebbert <76306.1226@compuserve.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9a0b5817
  19. 19 1月, 2006 2 次提交
    • A
      [PATCH] EDAC: core EDAC support code · da9bb1d2
      Alan Cox 提交于
      This is a subset of the bluesmoke project core code, stripped of the NMI work
      which isn't ready to merge and some of the "interesting" proc functionality
      that needs reworking or just has no place in kernel.  It requires no core
      kernel changes except the added scrub functions already posted.
      
      The goal is to merge further functionality only after the core code is
      accepted and proven in the base kernel, and only at the point the upstream
      extras are really ready to merge.
      
      From: doug thompson <norsk5@xmission.com>
      
        This converts EDAC to sysfs and is the final chunk neccessary before EDAC
        has a stable user space API and can be considered for submission into the
        base kernel.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: Ndoug thompson <norsk5@xmission.com>
      Signed-off-by: NPavel Machek <pavel@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      da9bb1d2
    • A
      [PATCH] EDAC: atomic scrub operations · 715b49ef
      Alan Cox 提交于
      EDAC requires a way to scrub memory if an ECC error is found and the chipset
      does not do the work automatically.  That means rewriting memory locations
      atomically with respect to all CPUs _and_ bus masters.  That means we can't
      use atomic_add(foo, 0) as it gets optimised for non-SMP
      
      This adds a function to include/asm-foo/atomic.h for the platforms currently
      supported which implements a scrub of a mapped block.
      
      It also adjusts a few other files include order where atomic.h is included
      before types.h as this now causes an error as atomic_scrub uses u32.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      715b49ef
  20. 10 1月, 2006 1 次提交
  21. 07 1月, 2006 1 次提交
  22. 14 11月, 2005 2 次提交
  23. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4