27 Jul, 2008

6 commits

  • This implements a platform-independent version of show_mem().

    Signed-off-by: Johannes Weiner
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Haavard Skinnemoen
    Cc: Bryan Wu
    Cc: Chris Zankel
    Cc: Ingo Molnar
    Cc: Jeff Dike
    Cc: David S. Miller
    Cc: Paul Mundt
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: David Howells
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Yoshinori Sato
    Cc: Ralf Baechle
    Cc: Greg Ungerer
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Cc: Hirokazu Takata
    Cc: Mikael Starvik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • This adds the new function task_current_syscall() on machines where the
    asm/syscall.h interface is supported (CONFIG_HAVE_ARCH_TRACEHOOK). It's
    exported for modules to use in the future. This function safely samples
    the state of a blocked thread to collect what system call it is blocked
    in, and the six system call argument registers.

    Signed-off-by: Roland McGrath
    Cc: Oleg Nesterov
    Reviewed-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     
  • Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes
    part of the warning section for better reporting/collection. In addition, one
    of the if() clauses collapes into the WARN() entirely now.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Kmem cache passed to constructor is only needed for constructors that are
    themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
    passed kmem cache in non-trivial way, so pass only pointer to object.

    Non-trivial places are:
    arch/powerpc/mm/init_64.c
    arch/powerpc/mm/hugetlbpage.c

    This is flag day, yes.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Cc: Jon Tollefson
    Cc: Nick Piggin
    Cc: Matt Mackall
    [akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
    [akpm@linux-foundation.org: fix mm/slab.c]
    [akpm@linux-foundation.org: fix ubifs]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Introduce gang_lookup_slot() and gang_lookup_slot_tag() functions, which
    are used by lockless pagecache.

    Signed-off-by: Nick Piggin
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Hugh Dickins
    Cc: "Paul E. McKenney"
    Reviewed-by: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
    architecture does:

    This enables us to cleanly fix the Calgary IOMMU issue that some devices
    are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).

    I think that per-device dma_mapping_ops support would be also helpful for
    KVM people to support PCI passthrough but Andi thinks that this makes it
    difficult to support the PCI passthrough (see the above thread). So I
    CC'ed this to KVM camp. Comments are appreciated.

    A pointer to dma_mapping_ops to struct dev_archdata is added. If the
    pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If it's
    NULL, the system-wide dma_ops pointer is used as before.

    If it's useful for KVM people, I plan to implement a mechanism to register
    a hook called when a new pci (or dma capable) device is created (it works
    with hot plugging). It enables IOMMUs to set up an appropriate
    dma_mapping_ops per device.

    The major obstacle is that dma_mapping_error doesn't take a pointer to the
    device unlike other DMA operations. So x86 can't have dma_mapping_ops per
    device. Note all the POWER IOMMUs use the same dma_mapping_error function
    so this is not a problem for POWER but x86 IOMMUs use different
    dma_mapping_error functions.

    The first patch adds the device argument to dma_mapping_error. The patch
    is trivial but large since it touches lots of drivers and dma-mapping.h in
    all the architecture.

    This patch:

    dma_mapping_error() doesn't take a pointer to the device unlike other DMA
    operations. So we can't have dma_mapping_ops per device.

    Note that POWER already has dma_mapping_ops per device but all the POWER
    IOMMUs use the same dma_mapping_error function. x86 IOMMUs use device
    argument.

    [akpm@linux-foundation.org: fix sge]
    [akpm@linux-foundation.org: fix svc_rdma]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix bnx2x]
    [akpm@linux-foundation.org: fix s2io]
    [akpm@linux-foundation.org: fix pasemi_mac]
    [akpm@linux-foundation.org: fix sdhci]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix sparc]
    [akpm@linux-foundation.org: fix ibmvscsi]
    Signed-off-by: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Cc: Andi Kleen
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

26 Jul, 2008

13 commits

  • Introduce the free_layer() routine: it is the one that actually frees memory
    after a grace period has elapsed.

    Signed-off-by: Nadia Derbey
    Reviewed-by: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • Make idr_find rcu-safe: it can now be called inside an rcu_read critical
    section.

    Signed-off-by: Nadia Derbey
    Reviewed-by: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • Make the idr_get_new* routines rcu-safe.

    Signed-off-by: Nadia Derbey
    Reviewed-by: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • Do some code factorization in the return code analysis.

    Signed-off-by: Nadia Derbey
    Cc: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • Fix the incomplete printk call.

    Signed-off-by: Nadia Derbey
    Reviewed-by: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • This is a trivial patch that renames:

    . alloc_layer to get_from_free_list since it idr_pre_get that actually
    allocates memory.
    . free_layer to move_to_free_list since memory is not actually freed there.

    This makes things more clear for the next patches.

    Signed-off-by: Nadia Derbey
    Reviewed-by: "Paul E. McKenney"
    Cc: Manfred Spraul
    Cc: Jim Houston
    Cc: Pierre Peiffer
    Acked-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     
  • All ratelimit user use same jiffies and burst params, so some messages
    (callbacks) will be lost.

    For example:
    a call printk_ratelimit(5 * HZ, 1)
    b call printk_ratelimit(5 * HZ, 1) before the 5*HZ timeout of a, then b will
    will be supressed.

    - rewrite __ratelimit, and use a ratelimit_state as parameter. Thanks for
    hints from andrew.

    - Add WARN_ON_RATELIMIT, update rcupreempt.h

    - remove __printk_ratelimit

    - use __ratelimit in net_ratelimit

    Signed-off-by: Dave Young
    Cc: "David S. Miller"
    Cc: "Paul E. McKenney"
    Cc: Dave Young
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     
  • Arjan noted that the list_head debugging is BUG'ing when it detects
    corruption. By causing the box to panic immediately, we're possibly
    losing some bug reports. Changing this to a WARN() should mean we at the
    least start seeing reports collected at kerneloops.org

    Signed-off-by: Dave Jones
    Cc: Matthew Wilcox
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • Now that WARN() exists, we can fold some of the printk's into it.

    Signed-off-by: Arjan van de Ven
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Inflate requires some dynamic memory allocation very early in the boot
    process and this is provided with a set of four functions:
    malloc/free/gzip_mark/gzip_release.

    The old inflate code used a mark/release strategy rather than implement
    free. This new version instead keeps a count on the number of outstanding
    allocations and when it hits zero, it resets the malloc arena.

    This allows removing all the mark and release implementations and unifying
    all the malloc/free implementations.

    The architecture-dependent code must define two addresses:
    - free_mem_ptr, the address of the beginning of the area in which
    allocations should be made
    - free_mem_end_ptr, the address of the end of the area in which
    allocations should be made. If set to 0, then no check is made on
    the number of allocations, it just grows as much as needed

    The architecture-dependent code can also provide an arch_decomp_wdog()
    function call. This function will be called several times during the
    decompression process, and allow to notify the watchdog that the system is
    still running. If an architecture provides such a call, then it must
    define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
    arch_decomp_wdog().

    Work initially done by Matt Mackall, updated to a recent version of the
    kernel and improved by me.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Thomas Petazzoni
    Cc: Matt Mackall
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: Haavard Skinnemoen
    Cc: David Howells
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Andi Kleen
    Cc: "H. Peter Anvin"
    Acked-by: Paul Mundt
    Acked-by: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Petazzoni
     
  • Remove the conditional surrounding the definition of list_add() from list.h
    since, if you define CONFIG_DEBUG_LIST, the definition you will subsequently
    pick up from lib/list_debug.c will be absolutely identical, at which point you
    can remove that redundant definition from list_debug.c as well.

    Signed-off-by: Robert P. J. Day
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Extend memparse() to allow the caller to use a NULL second parameter, which
    would represent no interest in returning the address of the end of the parsed
    string.

    In numerous cases, callers invoke memparse() to parse a possibly-suffixed
    string (such as "64K" or "2G" or whatever) and define a character pointer to
    accept the end pointer being returned by memparse() even though they have no
    interest in it and promptly throw it away.

    This (backward-compatible) enhancement allows callers to use NULL in the cases
    where they just don't care about getting back that end pointer.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Robert P. J. Day
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Signed-off-by: Harvey Harrison
    Acked-by: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

25 Jul, 2008

3 commits

  • This updates to define the key routines as constant
    functions, which the macros will then call. Newer code can now call
    bcd2bin() instead of SCREAMING BCD2BIN() TO THE FOUR WINDS.

    This lets each driver shrink their codespace by using N function calls to
    a single (global) copy of those routines, instead of N inlined copies of
    these functions per driver.

    These routines aren't used in speed-critical code. Almost all callers are
    in the RTC framework. Typical per-driver savings is near 300 bytes.

    Signed-off-by: David Brownell
    Acked-by: Adrian Bunk
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • lib/debugobjects.c has a function to test if an object is on the stack.
    The block layer and ide needs it (they need to avoid DMA from/to stack
    buffers). This patch moves the function to include/linux/sched.h so that
    everyone can use it.

    lib/debugobjects.c uses current->stack but this patch uses a
    task_stack_page() accessor, which is a preferable way to access the stack.

    Signed-off-by: FUJITA Tomonori
    Cc: Christoph Lameter
    Cc: Andy Whitcroft
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     
  • Boot initialisation is very complex, with significant numbers of
    architecture-specific routines, hooks and code ordering. While significant
    amounts of the initialisation is architecture-independent, it trusts the data
    received from the architecture layer. This is a mistake, and has resulted in
    a number of difficult-to-diagnose bugs.

    This patchset adds some validation and tracing to memory initialisation. It
    also introduces a few basic defensive measures. The validation code can be
    explicitly disabled for embedded systems.

    This patch:

    Add additional debugging and verification code for memory initialisation.

    Once enabled, the verification checks are always run and when required
    additional debugging information may be outputted via a mminit_loglevel=
    command-line parameter.

    The verification code is placed in a new file mm/mm_init.c. Ideally other mm
    initialisation code will be moved here over time.

    Signed-off-by: Mel Gorman
    Cc: Christoph Lameter
    Cc: Andy Whitcroft
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     

24 Jul, 2008

4 commits

  • * 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
    NR_CPUS: Replace NR_CPUS in speedstep-centrino.c
    cpumask: Provide a generic set of CPUMASK_ALLOC macros, FIXUP
    NR_CPUS: Replace NR_CPUS in cpufreq userspace routines
    NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genapic_flat_64.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/proc.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c, fix
    cpumask: Use optimized CPUMASK_ALLOC macros in the centrino_target
    cpumask: Provide a generic set of CPUMASK_ALLOC macros
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c
    cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c
    cpumask: Optimize cpumask_of_cpu in drivers/misc/sgi-xp/xpc_main.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/io_apic_64.c
    cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
    Revert "cpumask: introduce new APIs"
    cpumask: make for_each_cpu_mask a bit smaller
    net: Pass reference to cpumask variable in net/sunrpc/svc.c
    ...

    Fix up trivial conflicts in drivers/cpufreq/cpufreq.c manually

    Linus Torvalds
     
  • …ernel/git/tip/linux-2.6-tip

    * 'core/softlockup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    softlockup: fix invalid proc_handler for softlockup_panic
    softlockup: fix watchdog task wakeup frequency
    softlockup: fix watchdog task wakeup frequency
    softlockup: show irqtrace
    softlockup: print a module list on being stuck
    softlockup: fix NMI hangs due to lock race - 2.6.26-rc regression
    softlockup: fix false positives on nohz if CPU is 100% idle for more than 60 seconds
    softlockup: fix softlockup_thresh fix
    softlockup: fix softlockup_thresh unaligned access and disable detection at runtime
    softlockup: allow panic on lockup

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
    sdhci: highmem capable PIO routines
    sg: reimplement sg mapping iterator
    mmc_test: print message when attaching to card
    mmc: Remove Russell as primecell mci maintainer
    mmc_block: bounce buffer highmem support
    sdhci: fix bad warning from commit c8b3e02
    sdhci: add warnings for bad buffers in ADMA path
    mmc_test: test oversized sg lists
    mmc_test: highmem tests
    s3cmci: ensure host stopped on machine shutdown
    au1xmmc: suspend/resume implementation
    s3cmci: fixes for section mismatch warnings
    pxamci: trivial fix of DMA alignment register bit clearing

    Linus Torvalds
     
  • Remove HAVE_ARCH_KGDB_SHADOW_INFO because it does not
    exist anywhere in the kernel mainline sources

    Signed-off-by: Jason Wessel

    Jason Wessel
     

23 Jul, 2008

2 commits

  • This is alternative implementation of sg content iterator introduced
    by commit 83e7d317... from Pierre Ossman in next-20080716. As there's
    already an sg iterator which iterates over sg entries themselves, name
    this sg_mapping_iterator.

    Slightly edited description from the original implementation follows.

    Iteration over a sg list is not that trivial when you take into
    account that memory pages might have to be mapped before being used.
    Unfortunately, that means that some parts of the kernel restrict
    themselves to directly accesible memory just to not have to deal with
    the mess.

    This patch adds a simple iterator system that allows any code to
    easily traverse an sg list and not have to deal with all the details.
    The user can decide to consume part of the iteration. Also, iteration
    can be stopped and resumed later if releasing the kmap between
    iteration steps is necessary. These features are useful to implement
    piecemeal sg copying for interrupt drive PIO for example.

    Signed-off-by: Tejun Heo
    Signed-off-by: Pierre Ossman

    Tejun Heo
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    remove CONFIG_KMOD from core kernel code
    remove CONFIG_KMOD from lib
    remove CONFIG_KMOD from sparc64
    rework try_then_request_module to do less in non-modular kernels
    remove mention of CONFIG_KMOD from documentation
    make CONFIG_KMOD invisible
    modules: Take a shortcut for checking if an address is in a module
    module: turn longs into ints for module sizes
    Shrink struct module: CONFIG_UNUSED_SYMBOLS ifdefs
    module: reorder struct module to save space on 64 bit builds
    module: generic each_symbol iterator function
    module: don't use stop_machine for waiting rmmod

    Linus Torvalds
     

22 Jul, 2008

4 commits


21 Jul, 2008

1 commit


19 Jul, 2008

3 commits


18 Jul, 2008

2 commits


17 Jul, 2008

2 commits

  • make function tracing more robust: do not trace library functions.

    We've already got a sizable list of exceptions:

    ifdef CONFIG_FTRACE
    # Do not profile string.o, since it may be used in early boot or vdso
    CFLAGS_REMOVE_string.o = -pg
    # Also do not profile any debug utilities
    CFLAGS_REMOVE_spinlock_debug.o = -pg
    CFLAGS_REMOVE_list_debug.o = -pg
    CFLAGS_REMOVE_debugobjects.o = -pg
    CFLAGS_REMOVE_find_next_bit.o = -pg
    CFLAGS_REMOVE_cpumask.o = -pg
    CFLAGS_REMOVE_bitmap.o = -pg
    endif

    ... and the pattern has been that random library functionality showed
    up in ftrace's critical path (outside of its recursion check), causing
    hard to debug lockups.

    So be a bit defensive about it and exclude all lib/*.o functions by
    default. It's not that they are overly interesting for tracing purposes
    anyway. Specific ones can still be traced, in an opt-in manner.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • MAXSMP brings in lots of use of various bitops in smp_processor_id()
    and friends - causing ftrace to lock up during bootup:

    calling anon_inode_init+0x0/0x130
    initcall anon_inode_init+0x0/0x130 returned 0 after 0 msecs
    calling acpi_event_init+0x0/0x57
    [ hard hang ]

    So exclude the bitops facilities from tracing.

    Signed-off-by: Ingo Molnar

    Ingo Molnar