23 Mar, 2006

40 commits

  • This patch makes two needlessly global structs static.

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

    Adrian Bunk
     
  • Attempt to fix the problem wherein people's oops reports scroll off the screen
    due to repeated oopsing or to oopses on other CPUs.

    If this happens the user can reboot with the `pause_on_oops=' option.
    It will allow the first oopsing CPU to print an oops record just a single
    time. Second oopsing attempts, or oopses on other CPUs will cause those CPUs
    to enter a tight loop until the specified number of seconds have elapsed.

    The patch implements the infrastructure generically in the expectation that
    architectures other than x86 will find it useful.

    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • This patch removes all occurances of _INLINE_ in the kernel.

    With the exception of tty_flip.h, I've simply removed the inline's since
    gcc should know best which functions to be inlined.

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

    Adrian Bunk
     
  • Declarations use struct notifier_block on both legs of the ifdef, so move the
    notifier_block forward declaration outside the ifdef.

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

    Andrew Morton
     
  • Consolidate all kernel bug printouts to begin with the "BUG: " string.
    Makes it easier to find them in large bootup logs.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • The fat code uses the fat_lock always in a mutex way (taking and releasing
    the lock in the same function), the patch below converts it into the new
    mutex primitive. Please consider this patch for the code.

    Signed-off-by: Arjan van de Ven
    Acked-by: OGAWA Hirofumi
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • ext3's truncate_sem is always released in the same function it's taken
    and it otherwise is a mutex as well..

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

    Arjan van de Ven
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: Paul Clements
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Acked-by: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

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

    Arjan van de Ven
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: Alan Cox
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: John McCutchan
    Signed-off-by: Andrew Morton
    Acked-by: Robert Love
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Seems like needless clutter having a bunch of #if defined(CONFIG_$ARCH) in
    include/linux/cache.h. Move the per architecture section definition to
    asm/cache.h, and keep the if-not-defined dummy case in linux/cache.h to
    catch architectures which don't implement the section.

    Verified that symbols still go in .data.read_mostly on parisc,
    and the compile doesn't break.

    Signed-off-by: Kyle McMartin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyle McMartin
     
  • Since early 2.4.x all cdrom drivers implement the block_device methods
    themselves, so they can handle additional ioctls directly instead of going
    through the cdrom layer.

    Signed-off-by: Christoph Hellwig
    Acked-by: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • 1) Reduce the size of (struct fdtable) to exactly 64 bytes on 32bits
    platforms, lowering kmalloc() allocated space by 50%.

    2) Reduce the size of (files_struct), using a special 32 bits (or
    64bits) embedded_fd_set, instead of a 1024 bits fd_set for the
    close_on_exec_init and open_fds_init fields. This save some ram (248
    bytes per task) as most tasks dont open more than 32 files. D-Cache
    footprint for such tasks is also reduced to the minimum.

    3) Reduce size of allocated fdset. Currently two full pages are
    allocated, that is 32768 bits on x86 for example, and way too much. The
    minimum is now L1_CACHE_BYTES.

    UP and SMP should benefit from this patch, because most tasks will touch
    only one cache line when open()/close() stdin/stdout/stderr (0/1/2),
    (next_fd, close_on_exec_init, open_fds_init, fd_array[0 .. 2] being in the
    same cache line)

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

    Eric Dumazet
     
  • Linus points out that ext3_readdir's readahead only cuts in when
    ext3_readdir() is operating at the very start of the directory. So for large
    directories we end up performing no readahead at all and we suck.

    So take it all out and use the core VM's page_cache_readahead(). This means
    that ext3 directory reads will use all of readahead's dynamic sizing goop.

    Note that we're using the directory's filp->f_ra to hold the readahead state,
    but readahead is actually being performed against the underlying blockdev's
    address_space. Fortunately the readahead code is all set up to handle this.

    Tested with printk. It works. I was struggling to find a real workload which
    actually cared.

    (The patch also exports page_cache_readahead() to GPL modules)

    Cc: "Stephen C. Tweedie"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • It is unsafe to suspend devices if the hardware is controlled by X. Add an
    extra check to prevent this from happening.

    Signed-off-by: Rafael J. Wysocki
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Move externs from C source files to header files.

    Signed-off-by: Randy Dunlap
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Introduce the low level interface that can be used for handling the
    snapshot of the system memory by the in-kernel swap-writing/reading code of
    swsusp and the userland interface code (to be introduced shortly).

    Also change the way in which swsusp records the allocated swap pages and,
    consequently, simplifies the in-kernel swap-writing/reading code (this is
    necessary for the userland interface too). To this end, it introduces two
    helper functions in mm/swapfile.c, so that the swsusp code does not refer
    directly to the swap internals.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Gcc reserves %ebx when compiling position-independent-code on i386. This
    means, the _syscallX() macros in include/asm-i386/unistd.h will not
    compile. This patch is changes the existing macros to take special care to
    preserve %ebx.

    The bug can be tracked at http://bugzilla.kernel.org/show_bug.cgi?id=6204

    Signed-off-by: Markus Gutschke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Markus Gutschke
     
  • _raw_spin_lock_flags() is entered with interrupts disabled. If it cannot
    obtain a spinlock, it checks the flags that were passed and re-enables
    interrupts before spinning if that's how the flags are set. When the
    spinlock might be available, it disables interrupts (even if they are
    already disabled) before trying to get the lock. Change that so interrupts
    are only disabled if they have been enabled. This costs nine bytes of
    duplicated spinloop code.

    Fastpath before patch:
    jle not-taken conditional jump
    cli disable interrupts
    jmp unconditional jump

    Fastpath after patch, if interrupts were not enabled:
    jg taken conditional branch

    Signed-off-by: Chuck Ebbert
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuck Ebbert
     
  • arch/i386/kernel/cpu/centaur.c: In function `centaur_mcr_insert':
    arch/i386/kernel/cpu/centaur.c:33: warning: implicit declaration of function `mtrr_centaur_report_mcr'

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • >commit 76381fee7e8feb4c22be636aa5d4765dbe4fbf9e
    >Author: Vincent Hanquez
    >Date: Thu Jun 23 00:08:46 2005 -0700
    >
    > [PATCH] xen: x86_64: use more usermode macro
    >
    > Make use of the user_mode macro where it's possible. This is useful for Xen
    > because it will need only to redefine only the macro to a hypervisor call.

    I am of the opinion that the above changeset is incomplete, i.e. it missed
    converting some previous uses of user_mode to user_mode_vm. While most of
    them could be considered just cosmetical, at least the one in die_nmi
    doesn't appear to be.

    Signed-off-by: Jan Beulich
    Cc: Vincent Hanquez
    Cc: Zachary Amsden
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • Registering a callback handler through register_die_notifier() is obviously
    primarily intended for use by modules. However, the way these currently
    get called it is basically impossible for them to actually be used by
    modules, as there is, on non-PAE configurationes, a good chance (the larger
    the module, the better) for the system to crash as a result.

    This is because the callback gets invoked

    (a) in the page fault path before the top level page table propagation
    gets carried out (hence a fault to propagate the top level page table
    entry/entries mapping to module's code/data would nest infinitly) and

    (b) in the NMI path, where nested faults must absolutely not happen,
    since otherwise the IRET from the nested fault re-enables NMIs,
    potentially resulting in nested NMI occurences.

    Besides the modular aspect, similar problems would even arise for in-
    kernel consumers of the API if they touched ioremap()ed or vmalloc()ed
    memory inside their handlers.

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • The history is that -mm kernels do not work for me for a few months
    already. The things started from crashing somewhere after starting init,
    and for the last month - no boot at all, just "Uncompressing... OK,
    booting kernel", and silence. Early console didn't work too. With the
    latest releases this degraded into an infinite stream of the "Unknown
    interrupt or fault" messages. So today my patience ran out and I started
    to think how can I collect at least some info for the bug-report. Attached
    is the patch that allows to gather some valueable debug info on the problem
    by making an early console more useable. I can't properly test the patch,
    as the kernel still doesn't boot, so I'll explain it in details in a hope
    someone else can justify the intrusive changes.

    arch_hooks.h: added prototypes for setup_early_printk() and early_printk().

    setup.c: killed wrong setup_early_printk() prototype. Moved
    setup_early_printk() a bit earlier, as it was not "early enough" to cover
    the bug I was fighting with.

    early_printk.c: made it to start printing from the bottom of the screen,
    otherwise the messages interfere with the ones of the boot-loader, so you
    can't read them.

    Signed-off-by: Stas Sergeev
    Cc: Andi Kleen
    Cc: Zwane Mwaikambo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stas Sergeev
     
  • mp_bus_id_to_pci_bus is declared identically twice.

    Signed-off-by: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Wright
     
  • ES7000 platform code clean up for compilation errors and a warning.
    Ifdef'd the ACPI related parts in the ES7000 platform code. They were
    causing compile errors in certain configuration (without ACPI defined). I
    think this approach would be best (as opposed to Kconfig changes) since it
    only touches the subarch...

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

    Natalie.Protasevich@unisys.com
     
  • In some code I am developing I had occasion to change the type of a
    variable. This made the value put_user was putting to user space wrong.
    But the code continued to build cleanly without errors.

    Introducing a temporary fixes this problem and at least with gcc-3.3.5 does
    not cause gcc any problems with optimizing out the temporary. gcc-4.x
    using SSA internally ought to be even better at optimizing out temporaries,
    so I don't expect a temporary to become a problem. Especially because in
    all correct cases the types on both sides of the assignment to the
    temporary are the same.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • Implement SMP alternatives, i.e. switching at runtime between different
    code versions for UP and SMP. The code can patch both SMP->UP and UP->SMP.
    The UP->SMP case is useful for CPU hotplug.

    With CONFIG_CPU_HOTPLUG enabled the code switches to UP at boot time and
    when the number of CPUs goes down to 1, and switches to SMP when the number
    of CPUs goes up to 2.

    Without CONFIG_CPU_HOTPLUG or on non-SMP-capable systems the code is
    patched once at boot time (if needed) and the tables are released
    afterwards.

    The changes in detail:

    * The current alternatives bits are moved to a separate file,
    the SMP alternatives code is added there.

    * The patch adds some new elf sections to the kernel:
    .smp_altinstructions
    like .altinstructions, also contains a list
    of alt_instr structs.
    .smp_altinstr_replacement
    like .altinstr_replacement, but also has some space to
    save original instruction before replaving it.
    .smp_locks
    list of pointers to lock prefixes which can be nop'ed
    out on UP.
    The first two are used to replace more complex instruction
    sequences such as spinlocks and semaphores. It would be possible
    to deal with the lock prefixes with that as well, but by handling
    them as special case the table sizes become much smaller.

    * The sections are page-aligned and padded up to page size, so they
    can be free if they are not needed.

    * Splitted the code to release init pages to a separate function and
    use it to release the elf sections if they are unused.

    Signed-off-by: Gerd Hoffmann
    Signed-off-by: Chuck Ebbert
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gerd Hoffmann
     
  • Both R1BIO_Barrier and R1BIO_Returned are 4 !!!!

    This means that barrier requests don't get returned (i.e. b_endio called)
    because it looks like they already have been.

    Signed-off-by: Neil Brown
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown