28 Apr, 2008

3 commits

  • Add a new function gpiochip_reserve() to reserve ranges of gpios that platform
    code has pre-allocated. That is, this marks gpio numbers which will be
    claimed by drivers that haven't yet been loaded, and thus are not available
    for dynamic gpio number allocation.

    [akpm@linux-foundation.org: remove unneeded __must_check]
    [david-b@pacbell.net: don't export gpiochip_reserve (section fix)]
    Signed-off-by: Anton Vorontsov
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Introduce a gpio_is_valid() predicate; use it in gpiolib.

    Signed-off-by: Guennadi Liakhovetski
    [ use inline function; follow the gpio_* naming convention;
    work without gpiolib; all programming interfaces need docs ]
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • As long as one or more GPIOs on a gpio chip are used its driver should not be
    unloaded. The existing mechanism (gpiochip_remove failure) doesn't address
    that, since rmmod can no longer be made to fail by having the cleanup code
    report errors. Module usecounts are the solution.

    Assuming standard "initialize struct to zero" policies, this change won't
    affect SOC platform drivers. However, drivers for external chips (on I2C and
    SPI busses) should be updated if they can be built as modules.

    Signed-off-by: Guennadi Liakhovetski
    [ gpio_ensure_requested() needs to update module usecounts too ]
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     

27 Apr, 2008

3 commits

  • 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: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    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: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    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: Ingo Molnar

    Alexander van Heukelum
     

25 Apr, 2008

1 commit


20 Apr, 2008

1 commit

  • 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

    # fujitsu
    Cc: David Howells

    # ia64
    Cc: Tony Luck

    # powerpc
    Cc: Paul Mackerras
    Cc: Anton Blanchard

    # sparc
    Cc: David S. Miller
    Cc: William L. Irwin

    # x86
    Cc: H. Peter Anvin

    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Mike Travis
     

03 Apr, 2008

1 commit

  • 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 fb56dbb31c4738a3918db81fd24da732ce3b4ae6
    Author: Avi Kivity
    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 , which
    includes, not existing. Rather than add a zillion s, export kvm.
    only if the arch actually supports it.

    Signed-off-by: Avi Kivity

    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: Christian Borntraeger
    Acked-by: Avi Kivity
    Cc: Sam Ravnborg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christian Borntraeger
     

24 Feb, 2008

1 commit

  • 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: Hugh Dickins
    Reviewed-by: Mike Travis
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     

20 Feb, 2008

1 commit

  • 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: Sam Ravnborg

    Sam Ravnborg
     

12 Feb, 2008

1 commit


09 Feb, 2008

3 commits

  • Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set.

    Not all architectures support the A.OUT binfmt, so the ELF binfmt should not
    be permitted to go looking for A.OUT libraries to load in such a case. Not
    only that, but under such conditions A.OUT core dumps are not produced either.

    To make this work, this patch also does the following:

    (1) Makes the existence of the contents of linux/a.out.h contingent on
    CONFIG_ARCH_SUPPORTS_AOUT.

    (2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT
    core dumping code.

    (3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This
    is then included only where needed. This means that this bit of arch
    code will be stored in the appropriate A.OUT binfmt module rather than
    the core kernel.

    (4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not
    needed) and FRV.

    This patch depends on the previous patch to move STACK_TOP[_MAX] out of
    asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT
    format is available.

    [jdike@addtoit.com: uml: re-remove accidentally restored code]
    Signed-off-by: David Howells
    Cc:
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Give architectures that support the new termios2 the possibilty to overide the
    user_termios_to_kernel_termios and kernel_termios_to_user_termios macros. As
    soon as all architectures that use the generic variant have been converted the
    ifdefs can go away again. Architectures in question are avr32, frv, powerpc
    and s390.

    Cc: Alan Cox
    Cc: Paul Mackerras
    Cc: David Howells
    Cc: Haavard Skinnemoen
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

08 Feb, 2008

4 commits

  • 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: Mathieu Desnoyers
    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: Mathieu Desnoyers
    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: Christoph Lameter
    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: Mathieu Desnoyers
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Do not export asm/page.h during make headers_install. This removes PAGE_SIZE
    from userspace headers.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: David Woodhouse
    Cc: David Howells
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Do not export asm/elf.h during make headers_install.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • Do not export asm/user.h and linux/user.h during make headers_install.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: David Woodhouse
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Acked-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

07 Feb, 2008

2 commits

  • When passing a zero address to kallsyms_lookup(), the kernel thought it was
    a valid kernel address, even if it is not. This is because is_ksym_addr()
    called is_kernel_extratext() and checked against labels that don't exist on
    many archs (which default as zero). Since PPC was the only kernel which
    defines _extra_text, (in 2005), and no longer needs it, this patch removes
    _extra_text support.

    For some history (provided by Jon):
    http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019734.html
    http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019736.html
    http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019751.html

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Robin Getz
    Cc: David Woodhouse
    Cc: Jon Loeliger
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Getz
     
  • This moves the ability to scale cputime into generic code. This allows us
    to fix the issue in kernel/timer.c (noticed by Balbir) where we could only
    add an unscaled value to the scaled utime/stime.

    This adds a cputime_to_scaled function. As before, the POWERPC version
    does the scaling based on the last SPURR/PURR ratio calculated. The
    generic and s390 (only other arch to implement asm/cputime.h) versions are
    both NOPs.

    Also moves the SPURR and PURR snapshots closer.

    Signed-off-by: Michael Neuling
    Cc: Jay Lan
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Neuling
     

06 Feb, 2008

2 commits

  • (with Martin Schwidefsky )

    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: Benjamin Herrenschmidt
    Signed-off-by: Martin Schwidefsky
    Cc:
    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • 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: David Brownell
    Cc: Sam Ravnborg
    Cc: Jean Delvare
    Cc: Eric Miao
    Cc: Haavard Skinnemoen
    Cc: Philipp Zabel
    Cc: Russell King
    Cc: Ben Gardner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

04 Feb, 2008

2 commits

  • 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] [] warn_on_slowpath+0x41/0x51
    [ 7.819146] [] ? lock_release_holdtime+0x50/0x56
    [ 7.819146] [] ? check_usage_forwards+0x19/0x3b
    [ 7.819146] [] ? __lock_acquire+0xac3/0xb0b
    [ 7.819146] [] ? native_sched_clock+0x8b/0x9f
    [ 7.819146] [] ? lock_release_holdtime+0x50/0x56
    [ 7.819146] [] ? _spin_unlock_irq+0x22/0x42
    [ 7.819146] [] trace_hardirqs_on+0x9b/0x10d
    [ 7.819146] [] _spin_unlock_irq+0x22/0x42
    [ 7.819146] [] hpet_rtc_interrupt+0xdf/0x290
    [ 7.819146] [] handle_IRQ_event+0x1a/0x46
    [ 7.819146] [] handle_edge_irq+0xbe/0xff
    [ 7.819146] [] do_IRQ+0x6d/0x84
    [ 7.819146] [] common_interrupt+0x2e/0x34
    [ 7.819146] [] ? ktime_get_ts+0x8/0x3f
    [ 7.819146] [] ? lock_release+0x167/0x16f
    [ 7.819146] [] ? core_sys_select+0x2c/0x327
    [ 7.819146] [] core_sys_select+0x74/0x327
    [ 7.819146] [] ? native_sched_clock+0x8b/0x9f
    [ 7.819146] [] ? lock_release_holdtime+0x50/0x56
    [ 7.819146] [] ? _spin_unlock_irq+0x22/0x42
    [ 7.819146] [] ? trace_hardirqs_on+0xe6/0x10d
    [ 7.819146] [] ? _spin_unlock_irq+0x2d/0x42
    [ 7.819146] [] ? rtc_do_ioctl+0x11b/0x677
    [ 7.819146] [] ? inode_has_perm+0x5e/0x68
    [ 7.819146] [] ? lock_release_holdtime+0x50/0x56
    [ 7.819146] [] ? native_sched_clock+0x8b/0x9f
    [ 7.819146] [] ? file_has_perm+0x83/0x8c
    [ 7.819146] [] ? rtc_ioctl+0xf/0x11
    [ 7.819146] [] ? do_ioctl+0x55/0x67
    [ 7.819146] [] sys_select+0x93/0x163
    [ 7.819146] [] ? sysenter_past_esp+0x9a/0xa5
    [ 7.819146] [] 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: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Andrew Morton
     
  • Remove unused from ; per
    Christoph Lameter this should have been part of a previous patch
    reversal but apparently didn't get removed.

    Signed-off-by: H. Peter Anvin
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    H. Peter Anvin
     

01 Feb, 2008

1 commit

  • 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 a5a19c63f4e55e32dc0bc3d936d7f94793d8b380
    Author: Jeremy Fitzhardinge
    Date: Wed Jan 30 13:33:39 2008 +0100

    x86: demacro asm-x86/pgalloc_32.h

    Sorry about that!

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

30 Jan, 2008

8 commits

  • Latest update; I now have 4 NX tests, but 2 fail so they're #if 0'd.
    I also cleaned up the NX test code quite a bit, and got rid of the ugly
    exception table sorting stuff.

    From: Arjan van de Ven

    This patch adds testcases for the CONFIG_DEBUG_RODATA configuration option
    as well as the NX CPU feature/mappings. Both testcases can move to tests/
    once that patch gets merged into mainline.
    (I'm half considering moving the rodata test into mm/init.c but I'll
    wait with that until init.c is unified)

    As part of this I had to fix a not-quite-right alignment in the vmlinux.lds.h
    for the RODATA sections, which lead to 1 page less being marked read only.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Arjan van de Ven
     
  • Convert macros into inline functions, for better type-checking.

    This patch required a little bit of fiddling with headers in order to
    make __(pte|pmd)_free_tlb inline rather than macros.
    asm-generic/tlb.h includes asm/pgalloc.h, though it doesn't directly
    use any pgalloc definitions. I removed this include to avoid an
    include cycle, but it may cause secondary compile failures by things
    depending on the indirect inclusion; arch/x86/mm/hugetlbpage.c was one
    such place; there may be others.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Jeremy Fitzhardinge
     
  • Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Mike Travis
     
  • - add support for PER_CPU_ATTRIBUTES

    - fix generic smp percpu_modcopy to use per_cpu_offset() macro.

    Add the ability to use generic/percpu even if the arch needs to override
    several aspects of its operations. This will enable the use of generic
    percpu.h for all arches.

    An arch may define:

    __per_cpu_offset Do not use the generic pointer array. Arch must
    define per_cpu_offset(cpu) (used by x86_64, s390).

    __my_cpu_offset Can be defined to provide an optimized way to determine
    the offset for variables of the currently executing
    processor. Used by ia64, x86_64, x86_32, sparc64, s/390.

    SHIFT_PTR(ptr, offset) If an arch defines it then special handling
    of pointer arithmentic may be implemented. Used
    by s/390.

    (Some of these special percpu arch implementations may be later consolidated
    so that there are less cases to deal with.)

    Cc: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Christoph Lameter
    Signed-off-by: Mike Travis
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    travis@sgi.com
     
  • - Special consideration for IA64: Add the ability to specify
    arch specific per cpu flags

    - remove .data.percpu attribute from DEFINE_PER_CPU for non-smp case.

    The arch definitions are all the same. So move them into linux/percpu.h.

    We cannot move DECLARE_PER_CPU since some include files just include
    asm/percpu.h to avoid include recursion problems.

    Cc: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Christoph Lameter
    Signed-off-by: Mike Travis
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    travis@sgi.com
     
  • The use of the __GENERIC_PERCPU is a bit problematic since arches
    may want to run their own percpu setup while using the generic
    percpu definitions. Replace it through a kconfig variable.

    Cc: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Christoph Lameter
    Signed-off-by: Mike Travis
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    travis@sgi.com
     
  • A quick grep shows that there are currently 1145 instances of WARN_ON
    in the kernel. Currently, WARN_ON is pretty much entirely inlined,
    which makes it hard to enhance it without growing the size of the kernel
    (and getting Andrew unhappy).

    This patch build on top of Olof's patch that introduces __WARN,
    and places the slowpath out of line. It also uses Ingo's suggestion
    to not use __FUNCTION__ but to use kallsyms to do the lookup;
    this saves a ton of extra space since gcc doesn't need to store the function
    string twice now:

    3936367 833603 624736 5394706 525112 vmlinux.before
    3917508 833603 624736 5375847 520767 vmlinux-slowpath

    15Kb savings...

    Signed-off-by: Arjan van de Ven
    CC: Andrew Morton
    CC: Olof Johansson
    Acked-by: Matt Meckall
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Arjan van de Ven
     
  • Introduce __WARN() in the generic case, so the generic WARN_ON()
    can use arch-specific code for when the condition is true.

    Signed-off-by: Olof Johansson
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Olof Johansson
     

29 Jan, 2008

6 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (79 commits)
    Remove references to "make dep"
    kconfig: document use of HAVE_*
    Introduce new section reference annotations tags: __ref, __refdata, __refconst
    kbuild: warn about ld added unique sections
    kbuild: add verbose option to Section mismatch reporting in modpost
    kconfig: tristate choices with mixed tristate and boolean values
    asm-generic/vmlix.lds.h: simplify __mem{init,exit}* dependencies
    remove __attribute_used__
    kbuild: support ARCH=x86 in buildtar
    kconfig: remove "enable"
    kbuild: simplified warning report in modpost
    kbuild: introduce a few helpers in modpost
    kbuild: use simpler section mismatch warnings in modpost
    kbuild: link vmlinux.o before kallsyms passes
    kbuild: introduce new option to enhance section mismatch analysis
    Use separate sections for __dev/__cpu/__mem code/data
    compiler.h: introduce __section()
    all archs: consolidate init and exit sections in vmlinux.lds.h
    kbuild: check section names consistently in modpost
    kbuild: introduce blacklisting in modpost
    ...

    Linus Torvalds
     
  • This function is used by the ext4 multi block allocator patches.

    Also add generic_find_next_le_bit

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton

    Aneesh Kumar K.V
     
  • Today we have the following annotations for functions/data
    referencing __init/__exit functions / data:

    __init_refok => for init functions
    __initdata_refok => for init data
    __exit_refok => for exit functions

    There is really no difference between the __init and __exit
    versions and simplify it and to introduce a shorter annotation
    the following new annotations are introduced:

    __ref => for functions (code) that
    references __*init / __*exit
    __refdata => for variables
    __refconst => for const variables

    Whit this annotation is it more obvious what the annotation
    is for and there is no longer the arbitary division
    between __init and __exit code.

    The mechanishm is the same as before - a special section
    is created which is made part of the usual sections
    in the linker script.

    We will start to see annotations like this:

    -static struct pci_serial_quirk pci_serial_quirks[] = {
    +static const struct pci_serial_quirk pci_serial_quirks[] __refconst = {
    -----------------
    -static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
    +static struct notifier_block cpuid_class_cpu_notifier __refdata =
    ----------------
    -static int threshold_cpu_callback(struct notifier_block *nfb,
    +static int __ref threshold_cpu_callback(struct notifier_block *nfb,

    [The above is just random samples].

    Note: No modifications were needed in modpost
    to support the new sections due to the newly introduced
    blacklisting.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • Simplify the dependencies on __mem{init,exit}* (ACPI_HOTPLUG_MEMORY requires
    MEMORY_HOTPLUG).

    Signed-off-by: Adrian Bunk
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     
  • Introducing separate sections for __dev* (HOTPLUG),
    __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
    allows us to do a much more reliable Section mismatch
    check in modpost. We are no longer dependent on the actual
    configuration of for example HOTPLUG.

    This has the effect that all users see much more
    Section mismatch warnings than before because they
    were almost all hidden when HOTPLUG was enabled.
    The advantage of this is that when building a piece
    of code then it is much more likely that the Section
    mismatch errors are spotted and the warnings will be
    felt less random of nature.

    Signed-off-by: Sam Ravnborg
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Adrian Bunk

    Sam Ravnborg
     
  • This patch consolidate all definitions of .init.text, .init.data
    and .exit.text, .exit.data section definitions in
    the generic vmlinux.lds.h.

    This is a preparational patch - alone it does not buy
    us much good.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg