29 Apr, 2008

40 commits

  • Add a proper prototype for __do_softirq() in include/linux/interrupt.h

    Signed-off-by: Adrian Bunk
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • if (...) BUG(); should be replaced with BUG_ON(...) when the test has no
    side-effects to allow a definition of BUG_ON that drops the code completely.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @ disable unlikely @ expression E,f; @@

    (
    if () { BUG(); }
    |
    - if (unlikely(E)) { BUG(); }
    + BUG_ON(E);
    )

    @@ expression E,f; @@

    (
    if () { BUG(); }
    |
    - if (E) { BUG(); }
    + BUG_ON(E);
    )
    //

    Signed-off-by: Julia Lawall
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Almost all implementations of pci_iomap() in the kernel, including the generic
    lib/iomap.c one, copies the content of a struct resource into unsigned long's
    which will break on 32 bits platforms with 64 bits resources.

    This fixes all definitions of pci_iomap() to use resource_size_t. I also
    "fixed" the 64bits arch for consistency.

    Signed-off-by: Benjamin Herrenschmidt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • print_fn_descriptor_symbol() prints the address if we don't have a symbol, so
    no need to print both.

    Also, combine printing return value with elapsed time. Changes this:

    Calling initcall 0xc05b7a70: pci_mmcfg_late_insert_resources+0x0/0x50()
    initcall 0xc05b7a70: pci_mmcfg_late_insert_resources+0x0/0x50() returned 1.
    initcall 0xc05b7a70 ran for 0 msecs: pci_mmcfg_late_insert_resources+0x0/0x50()
    initcall at 0xc05b7a70: pci_mmcfg_late_insert_resources+0x0/0x50(): returned with error code 1

    to this:

    calling pci_mmcfg_late_insert_resources+0x0/0x50()
    initcall pci_mmcfg_late_insert_resources+0x0/0x50() returned 1 after 0 msecs
    initcall pci_mmcfg_late_insert_resources+0x0/0x50() returned with error code 1

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     
  • lib/inflate.c (inflate_dynamic): Don't deref NULL upon failed malloc.

    Signed-off-by: Jim Meyering
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Meyering
     
  • fs/hfsplus/options.c (hfsplus_parse_options): Handle match_strdup failure.

    Signed-off-by: Jim Meyering
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Meyering
     
  • fs/hfs/super.c (parse_options): Handle match_strdup failure, twice.

    Signed-off-by: Jim Meyering
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Meyering
     
  • fs/affs/super.c (parse_options): Remove useless initialization. Handle
    match_strdup failure.

    Signed-off-by: Jim Meyering
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jim Meyering
     
  • struct char_device_struct::fops is no longer used: remove it.

    Signed-off-by: Jiri Olsa
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Olsa
     
  • Remove unused leftovers of debugging functions. 2.6.25 material.

    Reported-by: Adrian Bunk
    Signed-off-by: Jiri Kosina
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • fs/autofs4/root.c:536:23: warning: symbol 'ino' shadows an earlier one
    fs/autofs4/root.c:510:22: originally declared here

    There is no need to redeclare, we are at the end of the loop and in
    the next iteration of the loop, ino will be reset.

    Signed-off-by: Harvey Harrison
    Acked-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Remove the no longer used mca_is_adapter_used().

    Signed-off-by: Adrian Bunk
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • I have not yet seen anyone saying he has a reasonable use case for using
    BINFMT_FLAT modular on his embedded device.

    Considering that fs/binfmt_flat.c even lacks a MODULE_LICENSE() I really doubt
    there is any, and this patch therefore makes BINFMT_FLAT a bool.

    Signed-off-by: Adrian Bunk
    Acked-by: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • cont_expand_zero() can become static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Remove the obsolete and no longer used generic_commit_write().

    Signed-off-by: Adrian Bunk
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Every file should include the headers containing the prototypes for its global
    functions (in this case for sys_timerfd_*()).

    Signed-off-by: Adrian Bunk
    Cc: Davide Libenzi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • 16 kB is often no longer enough for a normal boot of an UP system.

    And even less when people e.g. use suspend.

    17 seems to be a more reasonable default for current kernels on current
    hardware (it's just the default, anyone who is memory limited can still lower
    it).

    Signed-off-by: Adrian Bunk
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the following needlessly global functions static:

    - __put_ioctx()
    - lookup_ioctx()
    - io_submit_one()

    Signed-off-by: Adrian Bunk
    Cc: Zach Brown
    Cc: Benjamin LaHaise
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the following needlessly global functions static:

    - drop_pagecache()
    - drop_slab()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the following needlessly global functions static:

    - writeback_acquire()
    - writeback_release()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the needlessly global vfs_ioctl() static.

    Signed-off-by: Adrian Bunk
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Make the needlessly global __put_super() static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Move the extern declarations of several structs to vxfs_extern.h

    Signed-off-by: Adrian Bunk
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Add proper extern declarations for two structs in fs/hfsplus/hfsplus_fs.h

    Signed-off-by: Adrian Bunk
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • - internal.h shouldn't duplicate the extern declaration for
    ramfs_file_operations already in include/linux/ramfs.h
    - file-mmu.c needs two #include's for seeing the extern declarations
    of it's global struct's

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Fix following warnings:
    WARNING: vmlinux.o(.text+0xc60): Section mismatch in reference from the function kvm_init() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0x33869a): Section mismatch in reference from the function xfs_icsb_init_counters() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0x5556a1): Section mismatch in reference from the function acpi_processor_install_hotplug_notify() to the function .cpuinit.text:register_cpu_notifier()
    WARNING: vmlinux.o(.text+0xfe6b28): Section mismatch in reference from the function cpufreq_register_driver() to the function .cpuinit.text:register_cpu_notifier()

    register_cpu_notifier() are only really defined when HOTPLUG_CPU is enabled.
    So references to the function are OK.

    Annotate it with __ref so we do not get warnings from callers and do not get
    warnings for the functions/data used by register_cpu_notifier().

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Fix following warnings:
    WARNING: vmlinux.o(.text+0x75c8d): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75d2a): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75d4d): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75de4): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
    WARNING: vmlinux.o(.text+0x75e33): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

    cpu_down is only used from code surrounded by HOTPLUG_CPU so any references to
    __cpuinit is OK.

    Add a few __ref to tech modpost to ignore the references.

    This is just papering over the fact that the cpu hotplug code is fragile with
    respect to use of HOTPLUG_CPU and in many cases rely on __cpuinit to get rid
    of code when HOTPLUG_CPU is not enabled. For now this is the least invasive
    change.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Fix following warning:
    WARNING: vmlinux.o(.text+0x75f4e): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain

    We know that unregister_cpu_notifier is using HOTPLUG_CPU
    stuff - so ignore these references.
    Annotating unregister_cpu_notifier had been another option
    but this caused far more warnings since not all callers were
    annotated __cpuinit.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Fix following warnings:
    WARNING: vmlinux.o(.data+0x5020): Section mismatch in reference from the variable cpu_vsyscall_notifier_nb.12876 to the function .cpuinit.text:cpu_vsyscall_notifier()
    WARNING: vmlinux.o(.data+0x9ce0): Section mismatch in reference from the variable profile_cpu_callback_nb.17654 to the function .devinit.text:profile_cpu_callback()
    WARNING: vmlinux.o(.data+0xd380): Section mismatch in reference from the variable workqueue_cpu_callback_nb.15004 to the function .devinit.text:workqueue_cpu_callback()
    WARNING: vmlinux.o(.data+0x11d00): Section mismatch in reference from the variable relay_hotcpu_callback_nb.19626 to the function .cpuinit.text:relay_hotcpu_callback()
    WARNING: vmlinux.o(.data+0x12970): Section mismatch in reference from the variable cpu_callback_nb.24694 to the function .devinit.text:cpu_callback()
    WARNING: vmlinux.o(.data+0x3fee0): Section mismatch in reference from the variable percpu_counter_hotcpu_callback_nb.10903 to the function .cpuinit.text:percpu_counter_hotcpu_callback()
    WARNING: vmlinux.o(.data+0x74ce0): Section mismatch in reference from the variable topology_cpu_callback_nb.12506 to the function .cpuinit.text:topology_cpu_callback()

    Functions used as argument are by definition only used in HOTPLUG_CPU
    situations so thay are annotated __cpuinit. Annotate the static variable used
    by hotcpu_register with __cpuinitdata to match this definition.

    Signed-off-by: Sam Ravnborg
    Cc: Gautham R Shenoy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     
  • Use link as the variable name to avoid shadowing the arg.

    fs/befs/linuxvfs.c:492:8: warning: symbol 'p' shadows an earlier one
    fs/befs/linuxvfs.c:488:77: originally declared here

    Signed-off-by: Harvey Harrison
    Cc: "Sergey S. Kostyliov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • coda_unlink, coda_rmdir, coda_readdir can all be static, the forward
    declarations already were.

    Signed-off-by: Harvey Harrison
    Cc: Jan Harkes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Add the RUSAGE_THREAD option for the getrusage system call. This is
    essentially Roland's patch from http://lkml.org/lkml/2008/1/18/589, but the
    line about RUSAGE_LWP line has been removed, as suggested by Ulrich and
    Christoph.

    Signed-off-by: Roland McGrath
    Signed-off-by: Sripathi Kodi
    Cc: Ingo Molnar
    Cc: Michael Kerrisk
    Cc: Ulrich Drepper
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sripathi Kodi
     
  • fs/adfs/dir_f.c:126:4: warning: do-while statement is not a compound statement

    Signed-off-by: Harvey Harrison
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • The kernel is sent to tainted within the warn_on_slowpath() function, and
    whenever a warning occurs the new taint flag 'W' is set. This is useful to
    know if a warning occurred before a BUG by preserving the warning as a flag
    in the taint state.

    This does not work on architectures where WARN_ON has its own definition.
    These archs are:
    1. s390
    2. superh
    3. avr32
    4. parisc

    The maintainers of these architectures have been added in the Cc: list
    in this email to alert them to the situation.

    The documentation in oops-tracing.txt has been updated to include the
    new flag.

    Signed-off-by: Nur Hussein
    Cc: Arjan van de Ven
    Cc: "Randy.Dunlap"
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: Haavard Skinnemoen
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nur Hussein
     
  • They're defined later on in the same file with bodies and nothing in
    between needs them.

    Signed-off-by: Ilpo Järvinen
    Reviewed-by: Pekka Enberg
    Acked-by: Jan Harkes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ilpo Järvinen
     
  • BITS_PER_LONG is a signed value (32 or 64)

    DIV_ROUND_UP(nr, BITS_PER_LONG) performs signed arithmetic if "nr" is signed too.

    Converting BITS_TO_LONGS(nr) to DIV_ROUND_UP(nr, BITS_PER_BYTE *
    sizeof(long)) makes sure compiler can perform a right shift, even if "nr"
    is a signed value, instead of an expensive integer divide.

    Applying this patch saves 141 bytes on x86 when CONFIG_CC_OPTIMIZE_FOR_SIZE=y
    and speedup bitmap operations.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • Epoll calls rb_set_parent(n, n) to initialize the rb-tree node, but
    rb_set_parent() accesses node's pointer in its code. This creates a
    warning in kmemcheck (reported by Vegard Nossum) about an uninitialized
    memory access. The warning is harmless since the following rb-tree node
    insert is going to overwrite the node data. In any case I think it's
    better to not have that happening at all, and fix it by simplifying the
    code to get rid of a few lines that became superfluous after the previous
    epoll changes.

    Signed-off-by: Davide Libenzi
    Cc: Vegard Nossum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davide Libenzi
     
  • Make /dev/kmem a config option; /dev/kmem is VERY rarely used, and when
    used, it's generally for no good (rootkits tend to be the most common
    users). With this config option, users have the choice to disable
    /dev/kmem, saving some size as well.

    A patch to disable /dev/kmem has been in the Fedora and RHEL kernels for
    4+ years now without any known problems or legit users of /dev/kmem.

    [akpm@linux-foundation.org: make CONFIG_DEVKMEM default to y]
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Cc: Greg KH
    Cc: "Rafael J. Wysocki"
    Cc: Len Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Add __GFP_REPEAT to hugepage allocations. Do so to not necessitate userspace
    putting pressure on the VM by repeated echo's into /proc/sys/vm/nr_hugepages
    to grow the pool. With the previous patch to allow for large-order
    __GFP_REPEAT attempts to loop for a bit (as opposed to indefinitely), this
    increases the likelihood of getting hugepages when the system experiences (or
    recently experienced) load.

    Mel tested the patchset on an x86_32 laptop. With the patches, it was easier
    to use the proc interface to grow the hugepage pool. The following is the
    output of a script that grows the pool as much as possible running on
    2.6.25-rc9.

    Allocating hugepages test
    -------------------------
    Disabling OOM Killer for current test process
    Starting page count: 0
    Attempt 1: 57 pages Progress made with 57 pages
    Attempt 2: 73 pages Progress made with 16 pages
    Attempt 3: 74 pages Progress made with 1 pages
    Attempt 4: 75 pages Progress made with 1 pages
    Attempt 5: 77 pages Progress made with 2 pages

    77 pages was the most it allocated but it took 5 attempts from userspace
    to get it. With the 3 patches in this series applied,

    Allocating hugepages test
    -------------------------
    Disabling OOM Killer for current test process
    Starting page count: 0
    Attempt 1: 75 pages Progress made with 75 pages
    Attempt 2: 76 pages Progress made with 1 pages
    Attempt 3: 79 pages Progress made with 3 pages

    And 79 pages was the most it got. Your patches were able to allocate the
    bulk of possible pages on the first attempt.

    Signed-off-by: Nishanth Aravamudan
    Cc: Andy Whitcroft
    Tested-by: Mel Gorman
    Cc: Dave Hansen
    Cc: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nishanth Aravamudan