Skip to content
  1. Dec 28, 2009
    • Akinobu Mita's avatar
      x86, core: Optimize hweight32() · 39d997b5
      Akinobu Mita authored
      
      
      Optimize hweight32 by using the same technique in hweight64.
      
      The proof of this technique can be found in the commit log for
      f9b41929 ("bitops: hweight()
      speedup").
      
      The userspace benchmark on x86_32 showed 20% speedup with
      bitmap_weight() which uses hweight32 to count bits for each
      unsigned long on 32bit architectures.
      
       int main(void)
       {
      	#define SZ (1024 * 1024 * 512)
      
      	static DECLARE_BITMAP(bitmap, SZ) = {
      	        [0 ... 100] = 1,
      	};
      
      	return bitmap_weight(bitmap, SZ);
       }
      
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <1258603932-4590-1-git-send-email-akinobu.mita@gmail.com>
      [ only x86 sets ARCH_HAS_FAST_MULTIPLIER so we do this via the x86 tree]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      39d997b5
  2. Dec 22, 2009
  3. Dec 17, 2009
    • Uwe Kleine-König's avatar
      lib/vsprintf.c: document more vsnprintf extensions · 8a79503a
      Uwe Kleine-König authored
      These were added in
      
      9ac6e44 (lib/vsprintf.c: add %pU to print UUID/GUIDs)
      c7dabef (vsprintf: use %pR, %pr instead of %pRt, %pRf)
      8a27f7c (lib/vsprintf.c: Add "%pI6c" - print pointer as compressed ipv6 address)
      4aa9960 (printk: add %I4, %I6, %i4, %i6 format specifiers)
      dd45c9c (printk: add %pM format specifier for MAC addresses)
      
      but only added comments to pointer() not vsnprintf() that is refered to by
      printk's comments.
      
      Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Harvey Harrison <harvey.harrison@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joe Perches <joe@perches.com>
      Cc: Jens Rosenboom <jens@mcbone.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
      8a79503a
  4. Dec 16, 2009
    • Akinobu Mita's avatar
    • Akinobu Mita's avatar
      iommu-helper: use bitmap library · a66022c4
      Akinobu Mita authored
      
      
      Use bitmap library and kill some unused iommu helper functions.
      
      1. s/iommu_area_free/bitmap_clear/
      
      2. s/iommu_area_reserve/bitmap_set/
      
      3. Use bitmap_find_next_zero_area instead of find_next_zero_area
      
        This cannot be simple substitution because find_next_zero_area
        doesn't check the last bit of the limit in bitmap
      
      4. Remove iommu_area_free, iommu_area_reserve, and find_next_zero_area
      
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a66022c4
    • Akinobu Mita's avatar
      bitmap: introduce bitmap_set, bitmap_clear, bitmap_find_next_zero_area · c1a2a962
      Akinobu Mita authored
      
      
      This introduces new bitmap functions:
      
      bitmap_set: Set specified bit area
      bitmap_clear: Clear specified bit area
      bitmap_find_next_zero_area: Find free bit area
      
      These are mostly stolen from iommu helper. The differences are:
      
      - Use find_next_bit instead of doing test_bit for each bit
      
      - Rewrite bitmap_set and bitmap_clear
      
        Instead of setting or clearing for each bit.
      
      - Check the last bit of the limit
      
        iommu-helper doesn't want to find such area
      
      - The return value if there is no zero area
      
        find_next_zero_area in iommu helper: returns -1
        bitmap_find_next_zero_area: return >= bitmap size
      
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Lothar Wassmann <LW@KARO-electronics.de>
      Cc: Roland Dreier <rolandd@cisco.com>
      Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c1a2a962
    • Jan Beulich's avatar
      dma-mapping: fix off-by-one error in dma_capable() · ac2b3e67
      Jan Beulich authored
      
      
      dma_mask is, when interpreted as address, the last valid byte, and hence
      comparison msut also be done using the last valid of the buffer in
      question.
      
      Also fix the open-coded instances in lib/swiotlb.c.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Becky Bruce <beckyb@kernel.crashing.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ac2b3e67
  5. Dec 15, 2009
  6. Dec 14, 2009
  7. Dec 13, 2009
  8. Dec 12, 2009
    • Linus Torvalds's avatar
      [BKL] add 'might_sleep()' to the outermost lock taker · f01eb364
      Linus Torvalds authored
      
      
      As shown by the previous patch (6698e347: "tty: Fix BKL taken under a
      spinlock bug introduced in the BKL split") the BKL removal is prone to
      some subtle issues, where removing the BKL in one place may in fact make
      a previously nested BKL call the new outer call, and then prone to nasty
      deadlocks with other spinlocks.
      
      In general, we should never take the BKL while we're holding a spinlock,
      so let's just add a "might_sleep()" to it (even though the BKL doesn't
      technically sleep - at least not yet), and we'll get nice warnings the
      next time this kind of problem happens during BKL removal.
      
      Acked-and-Tested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f01eb364
  9. Dec 04, 2009
Loading