1. 10 3月, 2017 1 次提交
  2. 18 2月, 2017 1 次提交
    • N
      powerpc/64: Implement clear_bit_unlock_is_negative_byte() · d11914b2
      Nicholas Piggin 提交于
      Commit b91e1302 ("mm: optimize PageWaiters bit use for
      unlock_page()") added a special bitop function to speed up
      unlock_page(). Implement this for 64-bit powerpc.
      
      This improves the unlock_page() core code from this:
      
      	li	9,1
      	lwsync
      1:	ldarx	10,0,3,0
      	andc	10,10,9
      	stdcx.	10,0,3
      	bne-	1b
      	ori	2,2,0
      	ld	9,0(3)
      	andi.	10,9,0x80
      	beqlr
      	li	4,0
      	b	wake_up_page_bit
      
      To this:
      
      	li	10,1
      	lwsync
      1:	ldarx	9,0,3,0
      	andc	9,9,10
      	stdcx.	9,0,3
      	bne-	1b
      	andi.	10,9,0x80
      	beqlr
      	li	4,0
      	b	wake_up_page_bit
      
      In a test of elapsed time for dd writing into 16GB of already-dirty
      pagecache on a POWER8 with 4K pages, which has one unlock_page per 4kB
      this patch reduced overhead by 1.1%:
      
          N           Min           Max        Median           Avg        Stddev
      x  19         2.578         2.619         2.594         2.595         0.011
      +  19         2.552         2.592         2.564         2.565         0.008
      Difference at 95.0% confidence
      	-0.030  +/- 0.006
      	-1.142% +/- 0.243%
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      [mpe: Made 64-bit only until I can test it properly on 32-bit]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      d11914b2
  3. 12 11月, 2014 1 次提交
  4. 10 11月, 2014 1 次提交
  5. 18 4月, 2014 1 次提交
  6. 05 12月, 2013 1 次提交
  7. 18 4月, 2013 1 次提交
  8. 05 3月, 2013 1 次提交
  9. 15 11月, 2012 2 次提交
  10. 06 10月, 2012 1 次提交
  11. 17 11月, 2011 1 次提交
    • B
      powerpc: Fix atomic_xxx_return barrier semantics · b97021f8
      Benjamin Herrenschmidt 提交于
      The Documentation/memory-barriers.txt document requires that atomic
      operations that return a value act as a memory barrier both before
      and after the actual atomic operation.
      
      Our current implementation doesn't guarantee this. More specifically,
      while a load following the isync can not be issued before stwcx. has
      completed, that completion doesn't architecturally means that the
      result of stwcx. is visible to other processors (or any previous stores
      for that matter) (typically, the other processors L1 caches can still
      hold the old value).
      
      This has caused an actual crash in RCU torture testing on Power 7
      
      This fixes it by changing those atomic ops to use new macros instead
      of RELEASE/ACQUIRE barriers, called ATOMIC_ENTRY and ATMOIC_EXIT barriers,
      which are then defined respectively to lwsync and sync.
      
      I haven't had a chance to measure the performance impact (or rather
      what I measured with kernel compiles is in the noise, I yet have to
      find a more precise benchmark)
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      b97021f8
  12. 27 7月, 2011 1 次提交
  13. 31 3月, 2011 1 次提交
  14. 24 3月, 2011 5 次提交
    • A
      bitops: remove minix bitops from asm/bitops.h · 61f2e7b0
      Akinobu Mita 提交于
      minix bit operations are only used by minix filesystem and useless by
      other modules.  Because byte order of inode and block bitmaps is different
      on each architecture like below:
      
      m68k:
      	big-endian 16bit indexed bitmaps
      
      h8300, microblaze, s390, sparc, m68knommu:
      	big-endian 32 or 64bit indexed bitmaps
      
      m32r, mips, sh, xtensa:
      	big-endian 32 or 64bit indexed bitmaps for big-endian mode
      	little-endian bitmaps for little-endian mode
      
      Others:
      	little-endian bitmaps
      
      In order to move minix bit operations from asm/bitops.h to architecture
      independent code in minix filesystem, this provides two config options.
      
      CONFIG_MINIX_FS_BIG_ENDIAN_16BIT_INDEXED is only selected by m68k.
      CONFIG_MINIX_FS_NATIVE_ENDIAN is selected by the architectures which use
      native byte order bitmaps (h8300, microblaze, s390, sparc, m68knommu,
      m32r, mips, sh, xtensa).  The architectures which always use little-endian
      bitmaps do not select these options.
      
      Finally, we can remove minix bit operations from asm/bitops.h for all
      architectures.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NGreg Ungerer <gerg@uclinux.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      61f2e7b0
    • A
      bitops: remove ext2 non-atomic bitops from asm/bitops.h · f312eff8
      Akinobu Mita 提交于
      As the result of conversions, there are no users of ext2 non-atomic bit
      operations except for ext2 filesystem itself.  Now we can put them into
      architecture independent code in ext2 filesystem, and remove from
      asm/bitops.h for all architectures.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f312eff8
    • A
      powerpc: introduce little-endian bitops · f57d7ff1
      Akinobu Mita 提交于
      Introduce little-endian bit operations by renaming existing powerpc native
      little-endian bit operations and changing them to take any pointer types.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f57d7ff1
    • A
      asm-generic: change little-endian bitops to take any pointer types · a56560b3
      Akinobu Mita 提交于
      This makes the little-endian bitops take any pointer types by changing the
      prototypes and adding casts in the preprocessor macros.
      
      That would seem to at least make all the filesystem code happier, and they
      can continue to do just something like
      
        #define ext2_set_bit __test_and_set_bit_le
      
      (or whatever the exact sequence ends up being).
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Matthew Wilcox <willy@debian.org>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a56560b3
    • A
      asm-generic: rename generic little-endian bitops functions · c4945b9e
      Akinobu Mita 提交于
      As a preparation for providing little-endian bitops for all architectures,
      This renames generic implementation of little-endian bitops.  (remove
      "generic_" prefix and postfix "_le")
      
      s/generic_find_next_le_bit/find_next_bit_le/
      s/generic_find_next_zero_le_bit/find_next_zero_bit_le/
      s/generic_find_first_zero_le_bit/find_first_zero_bit_le/
      s/generic___test_and_set_le_bit/__test_and_set_bit_le/
      s/generic___test_and_clear_le_bit/__test_and_clear_bit_le/
      s/generic_test_le_bit/test_bit_le/
      s/generic___set_le_bit/__set_bit_le/
      s/generic___clear_le_bit/__clear_bit_le/
      s/generic_test_and_set_le_bit/test_and_set_bit_le/
      s/generic_test_and_clear_le_bit/test_and_clear_bit_le/
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4945b9e
  15. 29 11月, 2010 1 次提交
  16. 17 2月, 2010 2 次提交
  17. 20 8月, 2009 1 次提交
    • G
      powerpc: expose the multi-bit ops that underlie single-bit ops. · 0d2d3e38
      Geoff Thorpe 提交于
      The bitops.h functions that operate on a single bit in a bitfield are
      implemented by operating on the corresponding word location. In all
      cases the inner logic is valid if the mask being applied has more than
      one bit set, so this patch exposes those inner operations. Indeed,
      set_bits() was already available, but it duplicated code from
      set_bit() (rather than making the latter a wrapper) - it was also
      missing the PPC405_ERR77() workaround and the "volatile" address
      qualifier present in other APIs. This corrects that, and exposes the
      other multi-bit equivalents.
      
      One advantage of these multi-bit forms is that they allow word-sized
      variables to essentially be their own spinlocks, eg. very useful for
      state machines where an atomic "flags" variable can obviate the need
      for any additional locking.
      Signed-off-by: NGeoff Thorpe <geoff@geoffthorpe.net>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0d2d3e38
  18. 04 8月, 2008 1 次提交
  19. 27 4月, 2008 1 次提交
  20. 18 4月, 2008 2 次提交
  21. 29 1月, 2008 1 次提交
  22. 20 10月, 2007 1 次提交
  23. 19 10月, 2007 2 次提交
    • N
      powerpc: lock bitops · 66ffb04c
      Nick Piggin 提交于
      Add non-trivial lock bitops implementation for powerpc.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      66ffb04c
    • N
      bitops: introduce lock ops · 26333576
      Nick Piggin 提交于
      Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics.
      Convert all architectures to use the generic implementation.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Acked-By: NDavid Howells <dhowells@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Bryan Wu <bryan.wu@analog.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Matthew Wilcox <willy@debian.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
      Cc: Richard Curnow <rc@rc0.org.uk>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26333576
  24. 09 5月, 2007 1 次提交
  25. 12 12月, 2006 1 次提交
  26. 09 12月, 2006 1 次提交
  27. 09 7月, 2006 1 次提交
  28. 24 5月, 2006 1 次提交
  29. 27 3月, 2006 1 次提交
  30. 13 1月, 2006 1 次提交
    • A
      [PATCH] powerpc: use lwsync in atomics, bitops, lock functions · 144b9c13
      Anton Blanchard 提交于
      eieio is only a store - store ordering. When used to order an unlock
      operation loads may leak out of the critical region. This is potentially
      buggy, one example is if a user wants to atomically read a couple of
      values.
      
      We can solve this with an lwsync which orders everything except store - load.
      
      I removed the (now unused) EIEIO_ON_SMP macros and the c versions
      isync_on_smp and eieio_on_smp now we dont use them. I also removed some
      old comments that were used to identify inline spinlocks in assembly,
      they dont make sense now our locks are out of line.
      
      Another interesting thing was that read_unlock was using an eieio even
      though the rest of the spinlock code had already been converted to
      use lwsync.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      144b9c13
  31. 04 1月, 2006 1 次提交
  32. 10 11月, 2005 1 次提交
    • D
      [PATCH] powerpc: Consolidate asm compatibility macros · 3ddfbcf1
      David Gibson 提交于
      This patch consolidates macros used to generate assembly for
      compatibility across different CPUs or configs.  A new header,
      asm-powerpc/asm-compat.h contains the main compatibility macros.  It
      uses some preprocessor magic to make the macros suitable both for use
      in .S files, and in inline asm in .c files.  Headers (bitops.h,
      uaccess.h, atomic.h, bug.h) which had their own such compatibility
      macros are changed to use asm-compat.h.
      
      ppc_asm.h is now for use in .S files *only*, and a #error enforces
      that.  As such, we're a lot more careless about namespace pollution
      here than in asm-compat.h.
      
      While we're at it, this patch adds a call to the PPC405_ERR77 macro in
      futex.h which should have had it already, but didn't.
      
      Built and booted on pSeries, Maple and iSeries (ARCH=powerpc).  Built
      for 32-bit powermac (ARCH=powerpc) and Walnut (ARCH=ppc).
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3ddfbcf1