1. 03 5月, 2008 2 次提交
    • H
      types: add C99-style constructors to <asm-generic/int-*.h> · c25bd298
      H. Peter Anvin 提交于
      Add C99-style constructor macros for fixed types to
      <asm-generic/int-*.h>.  Since Linux uses names like "u64" instead of
      "uint64_t", the constructor macros are called U64_C() instead of
      UINT64_C() and so forth.
      
      These macros allow specific sizes to be specified as
      U64_C(0x123456789abcdef), without gcc issuing warnings as it will if
      one writes (u64)0x123456789abcdef.
      
      When used from assembly, these macros pass their argument unchanged.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      c25bd298
    • H
      types: create <asm-generic/int-*.h> · d13ff31c
      H. Peter Anvin 提交于
      This creates two generic files with common integer definitions; one
      where 64 bits is "long" (most 64-bit architectures) and one where 64
      bits is "long long" (all 32-bit architectures and x86-64.)
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Bryan Wu <cooloney@kernel.org>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: Kyle McMartin <kyle@parisc-linux.org>
      Cc: Lennert Buytenhek <kernel@wantstofly.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: William L. Irwin <wli@holomorphy.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      d13ff31c
  2. 01 5月, 2008 1 次提交
    • R
      rename div64_64 to div64_u64 · 6f6d6a1a
      Roman Zippel 提交于
      Rename div64_64 to div64_u64 to make it consistent with the other divide
      functions, so it clearly includes the type of the divide.  Move its definition
      to math64.h as currently no architecture overrides the generic implementation.
       They can still override it of course, but the duplicated declarations are
      avoided.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6f6d6a1a
  3. 30 4月, 2008 2 次提交
  4. 29 4月, 2008 2 次提交
  5. 28 4月, 2008 3 次提交
  6. 27 4月, 2008 3 次提交
    • A
      bitops: use __fls for fls64 on 64-bit archs · d57594c2
      Alexander van Heukelum 提交于
      Use __fls for fls64 on 64-bit archs. The implementation for
      64-bit archs is moved from x86_64 to asm-generic.
      Signed-off-by: NAlexander van Heukelum <heukelum@fastmail.fm>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d57594c2
    • A
      generic: introduce a generic __fls implementation · 7d9dff22
      Alexander van Heukelum 提交于
      Add a generic __fls implementation in the same spirit as
      the generic __ffs one. It finds the last (most significant)
      set bit in the given long value.
      Signed-off-by: NAlexander van Heukelum <heukelum@fastmail.fm>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7d9dff22
    • A
      x86, generic: optimize find_next_(zero_)bit for small constant-size bitmaps · 64970b68
      Alexander van Heukelum 提交于
      This moves an optimization for searching constant-sized small
      bitmaps form x86_64-specific to generic code.
      
      On an i386 defconfig (the x86#testing one), the size of vmlinux hardly
      changes with this applied. I have observed only four places where this
      optimization avoids a call into find_next_bit:
      
      In the functions return_unused_surplus_pages, alloc_fresh_huge_page,
      and adjust_pool_surplus, this patch avoids a call for a 1-bit bitmap.
      In __next_cpu a call is avoided for a 32-bit bitmap. That's it.
      
      On x86_64, 52 locations are optimized with a minimal increase in
      code size:
      
      Current #testing defconfig:
      	146 x bsf, 27 x find_next_*bit
         text    data     bss     dec     hex filename
         5392637  846592  724424 6963653  6a41c5 vmlinux
      
      After removing the x86_64 specific optimization for find_next_*bit:
      	94 x bsf, 79 x find_next_*bit
         text    data     bss     dec     hex filename
         5392358  846592  724424 6963374  6a40ae vmlinux
      
      After this patch (making the optimization generic):
      	146 x bsf, 27 x find_next_*bit
         text    data     bss     dec     hex filename
         5392396  846592  724424 6963412  6a40d4 vmlinux
      
      [ tglx@linutronix.de: build fixes ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      64970b68
  7. 25 4月, 2008 1 次提交
  8. 20 4月, 2008 1 次提交
    • M
      asm-generic: add node_to_cpumask_ptr macro · aa6b5446
      Mike Travis 提交于
      Create a simple macro to always return a pointer to the node_to_cpumask(node)
      value.  This relies on compiler optimization to remove the extra indirection:
      
          #define node_to_cpumask_ptr(v, node) 		\
      	    cpumask_t _##v = node_to_cpumask(node), *v = &_##v
      
      For those systems with a large cpumask size, then a true pointer
      to the array element can be used:
      
          #define node_to_cpumask_ptr(v, node)		\
      	    cpumask_t *v = &(node_to_cpumask_map[node])
      
      A node_to_cpumask_ptr_next() macro is provided to access another
      node_to_cpumask value.
      
      The other change is to always include asm-generic/topology.h moving the
      ifdef CONFIG_NUMA to this same file.
      
      Note: there are no references to either of these new macros in this patch,
      only the definition.
      
      Based on 2.6.25-rc5-mm1
      
      # alpha
      Cc: Richard Henderson <rth@twiddle.net>
      
      # fujitsu
      Cc: David Howells <dhowells@redhat.com>
      
      # ia64
      Cc: Tony Luck <tony.luck@intel.com>
      
      # powerpc
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      
      # sparc
      Cc: David S. Miller <davem@davemloft.net>
      Cc: William L. Irwin <wli@holomorphy.com>
      
      # x86
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      aa6b5446
  9. 03 4月, 2008 1 次提交
    • C
      kvm: provide kvm.h for all architecture: fixes headers_install · dd135ebb
      Christian Borntraeger 提交于
      Currently include/linux/kvm.h is not considered by make headers_install,
      because Kbuild cannot handle " unifdef-$(CONFIG_FOO) += foo.h.  This problem
      was introduced by
      
      commit fb56dbb3
      Author: Avi Kivity <avi@qumranet.com>
      Date:   Sun Dec 2 10:50:06 2007 +0200
      
          KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM
      
          Currently, make headers_check barfs due to <asm/kvm.h>, which <linux/kvm.h>
          includes, not existing.  Rather than add a zillion <asm/kvm.h>s, export kvm.
          only if the arch actually supports it.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      
      which makes this an 2.6.25 regression.
      
      One way of solving the issue is to enhance Kbuild, but Avi and David conviced
      me, that changing headers_install is not the way to go.  This patch changes
      the definition for linux/kvm.h to unifdef-y.
      
      If  unifdef-y is used for linux/kvm.h "make headers_check" will fail on all
      architectures without asm/kvm.h.  Therefore, this patch also provides
      asm/kvm.h on all architectures.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: NAvi Kivity <avi@qumranet.com>
      Cc: Sam Ravnborg <sam@ravnborg.org
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dd135ebb
  10. 24 2月, 2008 1 次提交
    • H
      percpu: fix DEBUG_PREEMPT per_cpu checking · 1e835278
      Hugh Dickins 提交于
      2.6.25-rc1 percpu changes broke CONFIG_DEBUG_PREEMPT's per_cpu checking
      on several architectures.  On s390, sparc64 and x86 it's been weakened to
      not checking at all; whereas on powerpc64 it's become too strict, issuing
      warnings from __raw_get_cpu_var in io_schedule and init_timer for example.
      
      Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
      local_paca instead of get_paca (which itself contains such a check);
      and strengthening the generic my_cpu_offset to go the old slow way via
      smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
      where all the knowledge of what's correct when lives).
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Reviewed-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e835278
  11. 20 2月, 2008 1 次提交
    • S
      Add missing init section definitions · 37c514e3
      Sam Ravnborg 提交于
      When adding __devinitconst etc. the __initconst variant
      were missed.
      Add this one and proper definitions for .head.text for use
      in .S files.
      The naming .head.text is preferred over .text.head as the
      latter will conflict for a function named head when introducing
      -ffunctions-sections.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      37c514e3
  12. 12 2月, 2008 1 次提交
  13. 09 2月, 2008 3 次提交
  14. 08 2月, 2008 4 次提交
    • M
      Add cmpxchg_local to asm-generic for per cpu atomic operations · 068fbad2
      Mathieu Desnoyers 提交于
      Emulates the cmpxchg_local by disabling interrupts around variable modification.
      This is not reentrant wrt NMIs and MCEs. It is only protected against normal
      interrupts, but this is enough for architectures without such interrupt sources
      or if used in a context where the data is not shared with such handlers.
      
      It can be used as a fallback for architectures lacking a real cmpxchg
      instruction.
      
      For architectures that have a real cmpxchg but does not have NMIs or MCE,
      testing which of the generic vs architecture specific cmpxchg is the fastest
      should be done.
      
      asm-generic/cmpxchg.h defines a cmpxchg that uses cmpxchg_local. It is meant to
      be used as a cmpxchg fallback for architectures that do not support SMP.
      
      * Patch series comments
      
      Using cmpxchg_local shows a performance improvements of the fast path goes from
      a 66% speedup on a Pentium 4 to a 14% speedup on AMD64.
      
      In detail:
      Tested-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Measurements on a Pentium4, 3GHz, Hyperthread.
      SLUB Performance testing
      ========================
      1. Kmalloc: Repeatedly allocate then free test
      
      * slub HEAD, test 1
      kmalloc(8) = 201 cycles         kfree = 351 cycles
      kmalloc(16) = 198 cycles        kfree = 359 cycles
      kmalloc(32) = 200 cycles        kfree = 381 cycles
      kmalloc(64) = 224 cycles        kfree = 394 cycles
      kmalloc(128) = 285 cycles       kfree = 424 cycles
      kmalloc(256) = 411 cycles       kfree = 546 cycles
      kmalloc(512) = 480 cycles       kfree = 619 cycles
      kmalloc(1024) = 623 cycles      kfree = 750 cycles
      kmalloc(2048) = 686 cycles      kfree = 811 cycles
      kmalloc(4096) = 482 cycles      kfree = 538 cycles
      kmalloc(8192) = 680 cycles      kfree = 734 cycles
      kmalloc(16384) = 713 cycles     kfree = 843 cycles
      
      * Slub HEAD, test 2
      kmalloc(8) = 190 cycles         kfree = 351 cycles
      kmalloc(16) = 195 cycles        kfree = 360 cycles
      kmalloc(32) = 201 cycles        kfree = 370 cycles
      kmalloc(64) = 245 cycles        kfree = 389 cycles
      kmalloc(128) = 283 cycles       kfree = 413 cycles
      kmalloc(256) = 409 cycles       kfree = 547 cycles
      kmalloc(512) = 476 cycles       kfree = 616 cycles
      kmalloc(1024) = 628 cycles      kfree = 753 cycles
      kmalloc(2048) = 684 cycles      kfree = 811 cycles
      kmalloc(4096) = 480 cycles      kfree = 539 cycles
      kmalloc(8192) = 661 cycles      kfree = 746 cycles
      kmalloc(16384) = 741 cycles     kfree = 856 cycles
      
      * cmpxchg_local Slub test
      kmalloc(8) = 83 cycles          kfree = 363 cycles
      kmalloc(16) = 85 cycles         kfree = 372 cycles
      kmalloc(32) = 92 cycles         kfree = 377 cycles
      kmalloc(64) = 115 cycles        kfree = 397 cycles
      kmalloc(128) = 179 cycles       kfree = 438 cycles
      kmalloc(256) = 314 cycles       kfree = 564 cycles
      kmalloc(512) = 398 cycles       kfree = 615 cycles
      kmalloc(1024) = 573 cycles      kfree = 745 cycles
      kmalloc(2048) = 629 cycles      kfree = 816 cycles
      kmalloc(4096) = 473 cycles      kfree = 548 cycles
      kmalloc(8192) = 659 cycles      kfree = 745 cycles
      kmalloc(16384) = 724 cycles     kfree = 843 cycles
      
      2. Kmalloc: alloc/free test
      
      * slub HEAD, test 1
      kmalloc(8)/kfree = 322 cycles
      kmalloc(16)/kfree = 318 cycles
      kmalloc(32)/kfree = 318 cycles
      kmalloc(64)/kfree = 325 cycles
      kmalloc(128)/kfree = 318 cycles
      kmalloc(256)/kfree = 328 cycles
      kmalloc(512)/kfree = 328 cycles
      kmalloc(1024)/kfree = 328 cycles
      kmalloc(2048)/kfree = 328 cycles
      kmalloc(4096)/kfree = 678 cycles
      kmalloc(8192)/kfree = 1013 cycles
      kmalloc(16384)/kfree = 1157 cycles
      
      * Slub HEAD, test 2
      kmalloc(8)/kfree = 323 cycles
      kmalloc(16)/kfree = 318 cycles
      kmalloc(32)/kfree = 318 cycles
      kmalloc(64)/kfree = 318 cycles
      kmalloc(128)/kfree = 318 cycles
      kmalloc(256)/kfree = 328 cycles
      kmalloc(512)/kfree = 328 cycles
      kmalloc(1024)/kfree = 328 cycles
      kmalloc(2048)/kfree = 328 cycles
      kmalloc(4096)/kfree = 648 cycles
      kmalloc(8192)/kfree = 1009 cycles
      kmalloc(16384)/kfree = 1105 cycles
      
      * cmpxchg_local Slub test
      kmalloc(8)/kfree = 112 cycles
      kmalloc(16)/kfree = 103 cycles
      kmalloc(32)/kfree = 103 cycles
      kmalloc(64)/kfree = 103 cycles
      kmalloc(128)/kfree = 112 cycles
      kmalloc(256)/kfree = 111 cycles
      kmalloc(512)/kfree = 111 cycles
      kmalloc(1024)/kfree = 111 cycles
      kmalloc(2048)/kfree = 121 cycles
      kmalloc(4096)/kfree = 650 cycles
      kmalloc(8192)/kfree = 1042 cycles
      kmalloc(16384)/kfree = 1149 cycles
      Tested-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Measurements on a AMD64 2.0 GHz dual-core
      
      In this test, we seem to remove 10 cycles from the kmalloc fast path.
      On small allocations, it gives a 14% performance increase. kfree fast
      path also seems to have a 10 cycles improvement.
      
      1. Kmalloc: Repeatedly allocate then free test
      
      * cmpxchg_local slub
      kmalloc(8) = 63 cycles      kfree = 126 cycles
      kmalloc(16) = 66 cycles     kfree = 129 cycles
      kmalloc(32) = 76 cycles     kfree = 138 cycles
      kmalloc(64) = 100 cycles    kfree = 288 cycles
      kmalloc(128) = 128 cycles   kfree = 309 cycles
      kmalloc(256) = 170 cycles   kfree = 315 cycles
      kmalloc(512) = 221 cycles   kfree = 357 cycles
      kmalloc(1024) = 324 cycles  kfree = 393 cycles
      kmalloc(2048) = 354 cycles  kfree = 440 cycles
      kmalloc(4096) = 394 cycles  kfree = 330 cycles
      kmalloc(8192) = 523 cycles  kfree = 481 cycles
      kmalloc(16384) = 643 cycles kfree = 649 cycles
      
      * Base
      kmalloc(8) = 74 cycles      kfree = 113 cycles
      kmalloc(16) = 76 cycles     kfree = 116 cycles
      kmalloc(32) = 85 cycles     kfree = 133 cycles
      kmalloc(64) = 111 cycles    kfree = 279 cycles
      kmalloc(128) = 138 cycles   kfree = 294 cycles
      kmalloc(256) = 181 cycles   kfree = 304 cycles
      kmalloc(512) = 237 cycles   kfree = 327 cycles
      kmalloc(1024) = 340 cycles  kfree = 379 cycles
      kmalloc(2048) = 378 cycles  kfree = 433 cycles
      kmalloc(4096) = 399 cycles  kfree = 329 cycles
      kmalloc(8192) = 528 cycles  kfree = 624 cycles
      kmalloc(16384) = 651 cycles kfree = 737 cycles
      
      2. Kmalloc: alloc/free test
      
      * cmpxchg_local slub
      kmalloc(8)/kfree = 96 cycles
      kmalloc(16)/kfree = 97 cycles
      kmalloc(32)/kfree = 97 cycles
      kmalloc(64)/kfree = 97 cycles
      kmalloc(128)/kfree = 97 cycles
      kmalloc(256)/kfree = 105 cycles
      kmalloc(512)/kfree = 108 cycles
      kmalloc(1024)/kfree = 105 cycles
      kmalloc(2048)/kfree = 107 cycles
      kmalloc(4096)/kfree = 390 cycles
      kmalloc(8192)/kfree = 626 cycles
      kmalloc(16384)/kfree = 662 cycles
      
      * Base
      kmalloc(8)/kfree = 116 cycles
      kmalloc(16)/kfree = 116 cycles
      kmalloc(32)/kfree = 116 cycles
      kmalloc(64)/kfree = 116 cycles
      kmalloc(128)/kfree = 116 cycles
      kmalloc(256)/kfree = 126 cycles
      kmalloc(512)/kfree = 126 cycles
      kmalloc(1024)/kfree = 126 cycles
      kmalloc(2048)/kfree = 126 cycles
      kmalloc(4096)/kfree = 384 cycles
      kmalloc(8192)/kfree = 749 cycles
      kmalloc(16384)/kfree = 786 cycles
      Tested-by: NChristoph Lameter <clameter@sgi.com>
      I can confirm Mathieus' measurement now:
      
      Athlon64:
      
      regular NUMA/discontig
      
      1. Kmalloc: Repeatedly allocate then free test
      10000 times kmalloc(8) -> 79 cycles kfree -> 92 cycles
      10000 times kmalloc(16) -> 79 cycles kfree -> 93 cycles
      10000 times kmalloc(32) -> 88 cycles kfree -> 95 cycles
      10000 times kmalloc(64) -> 124 cycles kfree -> 132 cycles
      10000 times kmalloc(128) -> 157 cycles kfree -> 247 cycles
      10000 times kmalloc(256) -> 200 cycles kfree -> 257 cycles
      10000 times kmalloc(512) -> 250 cycles kfree -> 277 cycles
      10000 times kmalloc(1024) -> 337 cycles kfree -> 314 cycles
      10000 times kmalloc(2048) -> 365 cycles kfree -> 330 cycles
      10000 times kmalloc(4096) -> 352 cycles kfree -> 240 cycles
      10000 times kmalloc(8192) -> 456 cycles kfree -> 340 cycles
      10000 times kmalloc(16384) -> 646 cycles kfree -> 471 cycles
      2. Kmalloc: alloc/free test
      10000 times kmalloc(8)/kfree -> 124 cycles
      10000 times kmalloc(16)/kfree -> 124 cycles
      10000 times kmalloc(32)/kfree -> 124 cycles
      10000 times kmalloc(64)/kfree -> 124 cycles
      10000 times kmalloc(128)/kfree -> 124 cycles
      10000 times kmalloc(256)/kfree -> 132 cycles
      10000 times kmalloc(512)/kfree -> 132 cycles
      10000 times kmalloc(1024)/kfree -> 132 cycles
      10000 times kmalloc(2048)/kfree -> 132 cycles
      10000 times kmalloc(4096)/kfree -> 319 cycles
      10000 times kmalloc(8192)/kfree -> 486 cycles
      10000 times kmalloc(16384)/kfree -> 539 cycles
      
      cmpxchg_local NUMA/discontig
      
      1. Kmalloc: Repeatedly allocate then free test
      10000 times kmalloc(8) -> 55 cycles kfree -> 90 cycles
      10000 times kmalloc(16) -> 55 cycles kfree -> 92 cycles
      10000 times kmalloc(32) -> 70 cycles kfree -> 91 cycles
      10000 times kmalloc(64) -> 100 cycles kfree -> 141 cycles
      10000 times kmalloc(128) -> 128 cycles kfree -> 233 cycles
      10000 times kmalloc(256) -> 172 cycles kfree -> 251 cycles
      10000 times kmalloc(512) -> 225 cycles kfree -> 275 cycles
      10000 times kmalloc(1024) -> 325 cycles kfree -> 311 cycles
      10000 times kmalloc(2048) -> 346 cycles kfree -> 330 cycles
      10000 times kmalloc(4096) -> 351 cycles kfree -> 238 cycles
      10000 times kmalloc(8192) -> 450 cycles kfree -> 342 cycles
      10000 times kmalloc(16384) -> 630 cycles kfree -> 546 cycles
      2. Kmalloc: alloc/free test
      10000 times kmalloc(8)/kfree -> 81 cycles
      10000 times kmalloc(16)/kfree -> 81 cycles
      10000 times kmalloc(32)/kfree -> 81 cycles
      10000 times kmalloc(64)/kfree -> 81 cycles
      10000 times kmalloc(128)/kfree -> 81 cycles
      10000 times kmalloc(256)/kfree -> 91 cycles
      10000 times kmalloc(512)/kfree -> 90 cycles
      10000 times kmalloc(1024)/kfree -> 91 cycles
      10000 times kmalloc(2048)/kfree -> 90 cycles
      10000 times kmalloc(4096)/kfree -> 318 cycles
      10000 times kmalloc(8192)/kfree -> 483 cycles
      10000 times kmalloc(16384)/kfree -> 536 cycles
      
      Changelog:
      - Ran though checkpatch.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      068fbad2
    • K
      Unexport asm/page.h · ed7b1889
      Kirill A. Shutemov 提交于
      Do not export asm/page.h during make headers_install.  This removes PAGE_SIZE
      from userspace headers.
      Signed-off-by: NKirill A. Shutemov <k.shutemov@gmail.com>
      Reviewed-by: NDavid Woodhouse <dwmw2@infradead.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      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>
      ed7b1889
    • K
      Unexport asm/elf.h · 6cc931b9
      Kirill A. Shutemov 提交于
      Do not export asm/elf.h during make headers_install.
      Signed-off-by: NKirill A. Shutemov <k.shutemov@gmail.com>
      Reviewed-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6cc931b9
    • K
      Unexport asm/user.h and linux/user.h · c1445db9
      Kirill A. Shutemov 提交于
      Do not export asm/user.h and linux/user.h during make headers_install.
      Signed-off-by: NKirill A. Shutemov <k.shutemov@gmail.com>
      Reviewed-by: NDavid Woodhouse <dwmw2@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c1445db9
  15. 07 2月, 2008 2 次提交
  16. 06 2月, 2008 2 次提交
    • B
      add mm argument to pte/pmd/pud/pgd_free · 5e541973
      Benjamin Herrenschmidt 提交于
      (with Martin Schwidefsky <schwidefsky@de.ibm.com>)
      
      The pgd/pud/pmd/pte page table allocation functions get a mm_struct pointer as
      first argument.  The free functions do not get the mm_struct argument.  This
      is 1) asymmetrical and 2) to do mm related page table allocations the mm
      argument is needed on the free function as well.
      
      [kamalesh@linux.vnet.ibm.com: i386 fix]
      [akpm@linux-foundation.org: coding-syle fixes]
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5e541973
    • D
      gpiolib: add gpio provider infrastructure · d2876d08
      David Brownell 提交于
      Provide new implementation infrastructure that platforms may choose to use
      when implementing the GPIO programming interface.  Platforms can update their
      GPIO support to use this.  In many cases the incremental cost to access a
      non-inlined GPIO should be less than a dozen instructions, with the memory
      cost being about a page (total) of extra data and code.  The upside is:
      
        * Providing two features which were "want to have (but OK to defer)" when
          GPIO interfaces were first discussed in November 2006:
      
          -	A "struct gpio_chip" to plug in GPIOs that aren't directly supported
      	by SOC platforms, but come from FPGAs or other multifunction devices
      	using conventional device registers (like UCB-1x00 or SM501 GPIOs,
      	and southbridges in PCs with more open specs than usual).
      
          -	Full support for message-based GPIO expanders, where registers are
      	accessed through sleeping I/O calls.  Previous support for these
      	"cansleep" calls was just stubs.  (One example: the widely used
      	pcf8574 I2C chips, with 8 GPIOs each.)
      
        * Including a non-stub implementation of the gpio_{request,free}() calls,
          making those calls much more useful.  The diagnostic labels are also
          recorded given DEBUG_FS, so /sys/kernel/debug/gpio can show a snapshot
          of all GPIOs known to this infrastructure.
      
      The driver programming interfaces introduced in 2.6.21 do not change at all;
      this infrastructure is entirely below those covers.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Eric Miao <eric.miao@marvell.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Philipp Zabel <philipp.zabel@gmail.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ben Gardner <bgardner@wabtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2876d08
  17. 04 2月, 2008 2 次提交
    • A
      x86: fix RTC lockdep warning: potential hardirq recursion · 795d45b2
      Andrew Morton 提交于
      After disabling both CONFIG_DEBUG_LOCKING_API_SELFTESTS and netconsole
      (using current mainline) I get a login prompt, and also...
      
      [    5.181668] SELinux: policy loaded with handle_unknown=deny
      [    5.183315] type=1403 audit(1202100038.157:3): policy loaded auid=4294967295 ses=4294967295
      [    5.822073] SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts
      [    7.819146] ------------[ cut here ]------------
      [    7.819146] WARNING: at kernel/lockdep.c:2033 trace_hardirqs_on+0x9b/0x10d()
      [    7.819146] Modules linked in: generic ext3 jbd ide_disk ide_core
      [    7.819146] Pid: 399, comm: hwclock Not tainted 2.6.24 #4
      [    7.819146]  [<c011d140>] warn_on_slowpath+0x41/0x51
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c013770c>] ? check_usage_forwards+0x19/0x3b
      [    7.819146]  [<c01390c4>] ? __lock_acquire+0xac3/0xb0b
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c030ca6c>] ? _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c013848b>] trace_hardirqs_on+0x9b/0x10d
      [    7.819146]  [<c030ca6c>] _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c011481e>] hpet_rtc_interrupt+0xdf/0x290
      [    7.819146]  [<c014ea90>] handle_IRQ_event+0x1a/0x46
      [    7.819146]  [<c014f8ea>] handle_edge_irq+0xbe/0xff
      [    7.819146]  [<c0106e08>] do_IRQ+0x6d/0x84
      [    7.819146]  [<c0105596>] common_interrupt+0x2e/0x34
      [    7.819146]  [<c013007b>] ? ktime_get_ts+0x8/0x3f
      [    7.819146]  [<c0139420>] ? lock_release+0x167/0x16f
      [    7.819146]  [<c017974a>] ? core_sys_select+0x2c/0x327
      [    7.819146]  [<c0179792>] core_sys_select+0x74/0x327
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c030ca6c>] ? _spin_unlock_irq+0x22/0x42
      [    7.819146]  [<c01384d6>] ? trace_hardirqs_on+0xe6/0x10d
      [    7.819146]  [<c030ca77>] ? _spin_unlock_irq+0x2d/0x42
      [    7.819146]  [<c023b437>] ? rtc_do_ioctl+0x11b/0x677
      [    7.819146]  [<c01c487e>] ? inode_has_perm+0x5e/0x68
      [    7.819146]  [<c01364a9>] ? lock_release_holdtime+0x50/0x56
      [    7.819146]  [<c0108c98>] ? native_sched_clock+0x8b/0x9f
      [    7.819146]  [<c01c490b>] ? file_has_perm+0x83/0x8c
      [    7.819146]  [<c023ba08>] ? rtc_ioctl+0xf/0x11
      [    7.819146]  [<c017898d>] ? do_ioctl+0x55/0x67
      [    7.819146]  [<c0179d15>] sys_select+0x93/0x163
      [    7.819146]  [<c0104b39>] ? sysenter_past_esp+0x9a/0xa5
      [    7.819146]  [<c0104afe>] sysenter_past_esp+0x5f/0xa5
      [    7.819146]  =======================
      [    7.819146] ---[ end trace 96540ca301ffb84c ]---
      [    7.819210] rtc: lost 6 interrupts
      [    7.870668] type=1400 audit(1202128840.794:4): avc:  denied  { audit_write } for  pid=399 comm="hwclock" capability=29 scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:hwclock_t:s0 tclass=capability
      [    9.538866] input: PC Speaker as /class/input/input5
      
      Because hpet_rtc_interrupt()'s call to get_rtc_time() ends up
      resolving to include/asm-generic/rtc.h's (hilariously inlined)
      get_rtc_time(), which does spin_unlock_irq() from hard IRQ context.
      
      The obvious patch fixes it.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      795d45b2
    • H
      asm-generic/tlb.h: remove <linux/quicklist.h> · e1adbcf1
      H. Peter Anvin 提交于
      Remove unused <linux/quicklist.h> from <asm-generic/tlb.h>; per
      Christoph Lameter this should have been part of a previous patch
      reversal but apparently didn't get removed.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      e1adbcf1
  18. 01 2月, 2008 1 次提交
    • I
      asm-generic/tlb.h: build fix · 62152d0e
      Ingo Molnar 提交于
      bring back the avr32, blackfin, sh, sparc architectures into working order,
      by reverting the effects of this change that came in via the x86 tree:
      
         commit a5a19c63
         Author: Jeremy Fitzhardinge <jeremy@goop.org>
         Date:   Wed Jan 30 13:33:39 2008 +0100
      
             x86: demacro asm-x86/pgalloc_32.h
      
      Sorry about that!
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      62152d0e
  19. 30 1月, 2008 7 次提交