17 Oct, 2007

40 commits

  • This patch cleans up duplicate includes in
    drivers/char/

    Signed-off-by: Jesper Juhl
    Cc: Richard Purdie
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Rrrr, addition of sysctl.h to fs.h was't very smart, because simple
    editing of the former will buy you big recompile, where it shouldn't
    have to.

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

    Alexey Dobriyan
     
  • Driver for the CompactFlash slot on the PA Semi Electra eval board. It's
    a simple device sitting on localbus, with interrupts and detect/voltage
    control over GPIO.

    The driver is implemented as an of_platform driver, and adds localbus
    as a bus being probed by the of_platform framework.

    [akpm@linux-foundation.org: cleanups]
    [olof@lixom.net: fix build]
    Signed-off-by: Olof Johansson
    Cc: Christoph Hellwig
    Cc: Milton Miller
    Cc: Kumar Gala
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Dominik Brodowski
    Signed-off-by: Olof Johansson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olof Johansson
     
  • Signed-off-by: Denis Cheng
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis Cheng
     
  • fs/proc/mmu.c consists of only one function which uses only:
    1) struct vmalloc_info *
    2) struct vm_struct *
    3) struct vmalloc_info
    4) vmlist
    5) VMALLOC_TOTAL, VMALLOC_START, VMALLOC_END
    6) read_lock, read_unlock
    7) vmlist_lock
    8) struct vm_struct

    This gives us linux/spinlock.h, asm/pgtable.h, "internal.h", linux/vmalloc.h.
    asm/pgtable.h uses PKMAP_BASE on i386, for which asm/highmem.h is needed.
    But, linux/highmem.h is actually used to make it compile everywhere.
    I'll deal later with this particular i386 surprise.

    Cross-compile tested on many archs and configs.

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

    Alexey Dobriyan
     
  • do_poll() checks signal_pending() but returns 0 when interrupted. This means
    the caller has to check signal_pending() again.

    Change it to return -EINTR when signal_pending() and count == 0.

    Signed-off-by: Oleg Nesterov
    Cc: Andi Kleen
    Cc: Davide Libenzi
    Cc: Vadim Lobanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Cleanup. Lessens both the source and compiled code (100 bytes) and imho makes
    the code much more understandable.

    With this patch "struct poll_list *head" always points to on-stack stack_pps,
    so we can remove all "is it on-stack" and "was it initialized" checks.

    Also, move poll_initwait/poll_freewait and -EINTR detection closer to the
    do_poll()'s callsite.

    [akpm@linux-foundation.org: fix warning (size_t != uint)]
    Signed-off-by: Oleg Nesterov
    Looks-good-to: Andi Kleen
    Cc: Davide Libenzi
    Cc: Vadim Lobanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Signed-off-by: Diego Woitasen
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Diego Woitasen
     
  • It makes more sense to make instrumentation support experimental on a
    case-by-case basis.

    Signed-off-by: Robert P. J. Day
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Signed-off-by: Philippe De Muyter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Philippe De Muyter
     
  • - There are no lists in fs/romfs/inode.c, so using list_entry
    is a bit confusing. Replace it with container_of.

    - It is unnecessary to cast the return value of
    kmem_cache_alloc, since it returns a void* pointer.

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

    WANG Cong
     
  • This memcpy looks so strange, in fact it's merely a pointer dereference, so I
    change the parameter's type to refer it more directly, this could make the
    memcpy not needed anymore.

    In the function nbd_read_stat where nbd_find_request is only once called, the
    parameter served should be transformed accordingly.

    Signed-off-by: Denis Cheng
    Cc: Paul Clements
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis Cheng
     
  • Thus the traverse of the loop may delete nodes, use the safe version.

    Signed-off-by: Denis Cheng
    Cc: Paul Clements
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis Cheng
     
  • DECLARE_MUTEX_LOCKED was used for semaphores used as completions and we've
    got rid of them. Well, except for one in libusual that the maintainer
    explicitly wants to keep as semaphore. So convert that useage to an
    explicit sema_init and kill of DECLARE_MUTEX_LOCKED so that new code is
    reminded to use a completion.

    Signed-off-by: Christoph Hellwig
    Acked-by: "Satyam Sharma"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • SHMLBA cant possible be used in userspace, see sparc versions of that header.

    Do not export asm/shmparam.h during make headers_install_all
    This removes another uservisible place of PAGE_SIZE

    Signed-off-by: Olaf Hering
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     
  • The Synchronous Serial Controller (SSC) on Atmel microprocessors are
    capable of tranceiving many frame based protocols, like I2S. Tested on the
    AT32AP7000/ATSTK1000.

    This driver is used in the ALSA sound driver for the AT73C213 external DAC
    on the ATSTK1000 development board for AVR32. This sound driver will be
    submitted soon.

    Hardware documentation can be found in the AT32AP7000 data sheet, which can
    be downloaded from
    http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

    [akpm@linux-foundation.org: init spinlock at compile time]
    Signed-off-by: Hans-Christian Egtvedt
    Acked-by: Haavard Skinnemoen
    Cc: David Brownell
    Cc: Andrew Victor
    Cc: Patrice Vilchez
    Cc: Nicolas Ferre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hans-Christian Egtvedt
     
  • Replace worthless comments with actual preprocessor errors when including
    the wrong versions of the compiler.h files.

    [akpm@linux-foundation.org: make it work]
    Signed-off-by: Robert P. J. Day
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • Use mutex instead of semaphore in fs/isofs/compress.c, and remove an
    unnecessary variable.

    Signed-off-by: Dave Young
    Acked-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Young
     
  • These aren't modular, so SLAB_PANIC is OK.

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

    Alexey Dobriyan
     
  • Control the trigger limit for softlockup warnings. This is useful for
    debugging softlockups, by lowering the softlockup_thresh to identify
    possible softlockups earlier.

    This patch:
    1. Adds a sysctl softlockup_thresh with valid values of 1-60s
    (Higher value to disable false positives)
    2. Changes the softlockup printk to print the cpu softlockup time

    [akpm@linux-foundation.org: Fix various warnings and add definition of "two"]
    Signed-off-by: Ravikiran Thirumalai
    Signed-off-by: Shai Fultheim
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ravikiran G Thirumalai
     
  • kernel/softirq.c grew a few style uncleanlinesses in the past few
    months, clean that up. No functional changes:

    text data bss dec hex filename
    1126 76 4 1206 4b6 softlockup.o.before
    1129 76 4 1209 4b9 softlockup.o.after

    ( the 3 bytes .text increase is due to the "" appended to one of
    the printk messages. )

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

    Ingo Molnar
     
  • Improve the debuggability of kernel lockups by enhancing the debug
    output of the softlockup detector: print the task that causes the lockup
    and try to print a more intelligent backtrace.

    The old format was:

    BUG: soft lockup detected on CPU#1!
    [] show_trace_log_lvl+0x19/0x2e
    [] show_trace+0x12/0x14
    [] dump_stack+0x14/0x16
    [] softlockup_tick+0xbe/0xd0
    [] run_local_timers+0x12/0x14
    [] update_process_times+0x3e/0x63
    [] tick_sched_timer+0x7c/0xc0
    [] hrtimer_interrupt+0x135/0x1ba
    [] smp_apic_timer_interrupt+0x6e/0x80
    [] apic_timer_interrupt+0x33/0x38
    [] syscall_call+0x7/0xb
    =======================

    The new format is:

    BUG: soft lockup detected on CPU#1! [prctl:2363]

    Pid: 2363, comm: prctl
    EIP: 0060:[] CPU: 1
    EIP is at sys_prctl+0x24/0x18c
    EFLAGS: 00000213 Not tainted (2.6.22-cfs-v20 #26)
    EAX: 00000001 EBX: 000003e7 ECX: 00000001 EDX: f6df0000
    ESI: 000003e7 EDI: 000003e7 EBP: f6df0fb0 DS: 007b ES: 007b FS: 00d8
    CR0: 8005003b CR2: 4d8c3340 CR3: 3731d000 CR4: 000006d0
    [] show_trace_log_lvl+0x19/0x2e
    [] show_trace+0x12/0x14
    [] show_regs+0x1ab/0x1b3
    [] softlockup_tick+0xef/0x108
    [] run_local_timers+0x12/0x14
    [] update_process_times+0x3e/0x63
    [] tick_sched_timer+0x7c/0xc0
    [] hrtimer_interrupt+0x135/0x1ba
    [] smp_apic_timer_interrupt+0x6e/0x80
    [] apic_timer_interrupt+0x33/0x38
    [] syscall_call+0x7/0xb
    =======================

    Note that in the old format we only knew that some system call locked
    up, we didnt know _which_. With the new format we know that it's at a
    specific place in sys_prctl(). [which was where i created an artificial
    kernel lockup to test the new format.]

    This is also useful if the lockup happens in user-space - the user-space
    EIP (and other registers) will be printed too. (such a lockup would
    either suggest that the task was running at SCHED_FIFO:99 and looping
    for more than 10 seconds, or that the softlockup detector has a
    false-positive.)

    The task name is printed too first, just in case we dont manage to print
    a useful backtrace.

    [satyam@infradead.org: fix warning]
    Signed-off-by: Ingo Molnar
    Signed-off-by: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • The softlockup detector would like to use get_irq_regs(), so generalize the
    availability on every Linux architecture.

    (It is fine for an architecture to always return NULL to get_irq_regs(),
    which it does by default.)

    Signed-off-by: Ingo Molnar
    Cc: Ian Molton
    Cc: Kumar Gala
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Mikael Starvik
    Cc: Miles Bader
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • this Xen related commit:

    commit 966812dc98e6a7fcdf759cbfa0efab77500a8868
    Author: Jeremy Fitzhardinge
    Date: Tue May 8 00:28:02 2007 -0700

    Ignore stolen time in the softlockup watchdog

    broke the softlockup watchdog to never report any lockups. (!)

    print_timestamp defaults to 0, this makes the following condition
    always true:

    if (print_timestamp < (touch_timestamp + 1) ||

    and we'll in essence never report soft lockups.

    apparently the functionality of the soft lockup watchdog was never
    actually tested with that patch applied ...

    Signed-off-by: Ingo Molnar
    Cc: Jeremy Fitzhardinge
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • sched_clock() is not a reliable time-source, use cpu_clock() instead.

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

    Ingo Molnar
     
  • Remove the rmb() from mce_log(), since the immunized version of
    rcu_dereference() makes it unnecessary.

    Signed-off-by: Paul E. McKenney
    Cc: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney
     
  • Turns out that compiler writers are a bit more aggressive about optimizing
    than one might expect. This patch prevents a number of such optimizations
    from messing up rcu_deference(). This is not merely a theoretical problem, as
    evidenced by the rmb() in mce_log().

    Signed-off-by: Paul E. McKenney
    Cc: Ingo Molnar
    Acked-by: Josh Triplett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney
     
  • list_del() hardly can fail, so checking for return value is pointless
    (and current code always return 0).

    Nobody really cared that return value anyway.

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

    Alexey Dobriyan
     
  • Switch single-linked binfmt formats list to usual list_head's. This leads
    to one-liners in register_binfmt() and unregister_binfmt(). The downside
    is one pointer more in struct linux_binfmt. This is not a problem, since
    the set of registered binfmts on typical box is very small -- (ELF +
    something distro enabled for you).

    Test-booted, played with executable .txt files, modprobe/rmmod binfmt_misc.

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

    Alexey Dobriyan
     
  • - remove the following no longer used functions:
    - bitmap.c: reiserfs_claim_blocks_to_be_allocated()
    - bitmap.c: reiserfs_release_claimed_blocks()
    - bitmap.c: reiserfs_can_fit_pages()

    - make the following functions static:
    - inode.c: restart_transaction()
    - journal.c: reiserfs_async_progress_wait()

    Signed-off-by: Adrian Bunk
    Acked-by: Vladimir V. Saveliev
    Cc: Nick Piggin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This is a writeback-internal marker but we're propagating it all the way back
    to userspace!.

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

    Andrew Morton
     
  • zone->lock is quite an "inner" lock and mostly constrained to page alloc as
    well, so like slab locks, it probably isn't something that is critically
    important to document here. However unlike slab locks, zone lock could be
    used more widely in future, and page_alloc.c might possibly have more
    business to do tricky things with pagecache than does slab. So... I don't
    think it hurts to document it.

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

    Nick Piggin
     
  • Introduces new zone flag interface for testing and setting flags:

    int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag)

    Instead of setting and clearing ZONE_RECLAIM_LOCKED each time shrink_zone() is
    called, this flag is test and set before starting zone reclaim. Zone reclaim
    starts in __alloc_pages() when a zone's watermark fails and the system is in
    zone_reclaim_mode. If it's already in reclaim, there's no need to start again
    so it is simply considered full for that allocation attempt.

    There is a change of behavior with regard to concurrent zone shrinking. It is
    now possible for try_to_free_pages() or kswapd to already be shrinking a
    particular zone when __alloc_pages() starts zone reclaim. In this case, it is
    possible for two concurrent threads to invoke shrink_zone() for a single zone.

    This change forbids a zone to be in zone reclaim twice, which was always the
    behavior, but allows for concurrent try_to_free_pages() or kswapd shrinking
    when starting zone reclaim.

    Cc: Andrea Arcangeli
    Cc: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • There's no reason to sleep in try_set_zone_oom() or clear_zonelist_oom() if
    the lock can't be acquired; it will be available soon enough once the zonelist
    scanning is done. All other threads waiting for the OOM killer are also
    contingent on the exiting task being able to acquire the lock in
    clear_zonelist_oom() so it doesn't make sense to put it to sleep.

    Cc: Andrea Arcangeli
    Cc: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Preprocess include/linux/oom.h before exporting it to userspace.

    Cc: Andrea Arcangeli
    Cc: Christoph Lameter
    Cc: Alexey Dobriyan
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • It's not necessary to include all of linux/sched.h in linux/oom.h. Instead,
    simply include prototypes for the relevant structs and include linux/types.h
    for gfp_t.

    Cc: Andrea Arcangeli
    Cc: Christoph Lameter
    Acked-by: Alexey Dobriyan
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Since no task descriptor's 'cpuset' field is dereferenced in the execution of
    the OOM killer anymore, it is no longer necessary to take callback_mutex.

    [akpm@linux-foundation.org: restore cpuset_lock for other patches]
    Cc: Andrea Arcangeli
    Acked-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Instead of testing for overlap in the memory nodes of the the nearest
    exclusive ancestor of both current and the candidate task, it is better to
    simply test for intersection between the task's mems_allowed in their task
    descriptors. This does not require taking callback_mutex since it is only
    used as a hint in the badness scoring.

    Tasks that do not have an intersection in their mems_allowed with the current
    task are not explicitly restricted from being OOM killed because it is quite
    possible that the candidate task has allocated memory there before and has
    since changed its mems_allowed.

    Cc: Andrea Arcangeli
    Acked-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Suppresses the extraneous stack and memory dump when a parallel OOM killing
    has been found. There's no need to fill the ring buffer with this information
    if its already been printed and the condition that triggered the previous OOM
    killer has not yet been alleviated.

    Cc: Andrea Arcangeli
    Acked-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Adds a new sysctl, 'oom_kill_allocating_task', which will automatically kill
    the OOM-triggering task instead of scanning through the tasklist to find a
    memory-hogging target. This is helpful for systems with an insanely large
    number of tasks where scanning the tasklist significantly degrades
    performance.

    Cc: Andrea Arcangeli
    Acked-by: Christoph Lameter
    Signed-off-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes