24 Sep, 2008

5 commits

  • posix_timer_event() always populates timer->sigq with the same numbers,
    move this code into sys_timer_create().

    Note that with this patch we can kill it_sigev_signo and it_sigev_value.

    Signed-off-by: Oleg Nesterov
    Cc: mingo@elte.hu
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Oleg Nesterov
     
  • - Change the code to do rcu_read_lock() instead of taking tasklist_lock,
    it is safe to get_task_struct(p) if p was found under RCU.

    However, now we must not use process's sighand/signal, they may be NULL.
    We can use current->sighand/signal instead, this "process" must belong
    to the current's thread-group.

    - Factor out the common code for 2 "if (timer_event_spec)" branches, the
    !timer_event_spec case can use current too.

    - use spin_lock_irq() instead of _irqsave(), kill "flags".

    Signed-off-by: Oleg Nesterov
    Cc: mingo@elte.hu
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Oleg Nesterov
     
  • sys_timer_create() return -EINVAL if the target thread has PF_EXITING.

    This doesn't really make sense, the sub-thread can die right after unlock.
    And in fact, this is just wrong. Without SIGEV_THREAD_ID good_sigevent()
    returns ->group_leader, and it is very possible that the leader is already
    dead. This is OK, we shouldn't return the error in this case.

    Remove this check and the comment. Note that the "process" was found
    under tasklist_lock, it must have ->sighand != NULL.

    Also, remove a couple of unneeded initializations.

    Signed-off-by: Oleg Nesterov
    Cc: mingo@elte.hu
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Oleg Nesterov
     
  • Change the code to get/put timer->it_process regardless of
    SIGEV_THREAD_ID. This streamlines the create/destroy paths and allows us
    to simplify the usage of exit_itimers() in de_thread().

    Signed-off-by: Oleg Nesterov
    Cc: mingo@elte.hu
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Oleg Nesterov
     
  • posix_timer_event() drops SIGEV_THREAD_ID and switches to ->group_leader
    if send_sigqueue() fails.

    This is not very useful and doesn't work reliably. send_sigqueue() can
    only fail if ->it_process is dead. But it can die before it dequeues the
    SI_TIMER signal, in that case the timer stops anyway.

    Remove this code. I guess it was needed a long ago to ensure that the
    timer is not destroyed when when its creator thread dies.

    Q: perhaps it makes sense to change sys_timer_settime() to return an error
    if ->it_process is dead?

    Signed-off-by: Oleg Nesterov
    Cc: mingo@elte.hu
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Oleg Nesterov
     

23 Sep, 2008

1 commit

  • This is the second resubmission of the posix timer rework patch, posted
    a few days ago.

    This includes the changes from the previous resubmittion, which addressed
    Oleg Nesterov's comments, removing the RCU stuff from the patch and
    un-inlining the thread_group_cputime() function for SMP.

    In addition, per Ingo Molnar it simplifies the UP code, consolidating much
    of it with the SMP version and depending on lower-level SMP/UP handling to
    take care of the differences.

    It also cleans up some UP compile errors, moves the scheduler stats-related
    macros into kernel/sched_stats.h, cleans up a merge error in
    kernel/fork.c and has a few other minor fixes and cleanups as suggested
    by Oleg and Ingo. Thanks for the review, guys.

    Signed-off-by: Frank Mayhar
    Cc: Roland McGrath
    Cc: Alexey Dobriyan
    Cc: Andrew Morton
    Signed-off-by: Ingo Molnar

    Frank Mayhar
     

14 Sep, 2008

34 commits

  • Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • fix the UP build:

    In file included from arch/x86/kernel/asm-offsets_32.c:9,
    from arch/x86/kernel/asm-offsets.c:3:
    include/linux/sched.h: In function ‘thread_group_cputime_clone_thread’:
    include/linux/sched.h:2272: warning: no return statement in function returning non-void
    include/linux/sched.h: In function ‘thread_group_cputime_account_user’:
    include/linux/sched.h:2284: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
    include/linux/sched.h:2284: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
    include/linux/sched.h: In function ‘thread_group_cputime_account_system’:
    include/linux/sched.h:2291: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
    include/linux/sched.h:2291: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
    include/linux/sched.h: In function ‘thread_group_cputime_account_exec_runtime’:
    include/linux/sched.h:2298: error: invalid type argument of ‘->’ (have ‘struct task_cputime’)
    distcc[14501] ERROR: compile arch/x86/kernel/asm-offsets.c on a/30 failed
    make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • fix:

    kernel/fork.c:843: error: ‘struct signal_struct’ has no member named ‘sum_sched_runtime’
    kernel/irq/handle.c:117: warning: ‘sparse_irq_lock’ defined but not used

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Overview

    This patch reworks the handling of POSIX CPU timers, including the
    ITIMER_PROF, ITIMER_VIRT timers and rlimit handling. It was put together
    with the help of Roland McGrath, the owner and original writer of this code.

    The problem we ran into, and the reason for this rework, has to do with using
    a profiling timer in a process with a large number of threads. It appears
    that the performance of the old implementation of run_posix_cpu_timers() was
    at least O(n*3) (where "n" is the number of threads in a process) or worse.
    Everything is fine with an increasing number of threads until the time taken
    for that routine to run becomes the same as or greater than the tick time, at
    which point things degrade rather quickly.

    This patch fixes bug 9906, "Weird hang with NPTL and SIGPROF."

    Code Changes

    This rework corrects the implementation of run_posix_cpu_timers() to make it
    run in constant time for a particular machine. (Performance may vary between
    one machine and another depending upon whether the kernel is built as single-
    or multiprocessor and, in the latter case, depending upon the number of
    running processors.) To do this, at each tick we now update fields in
    signal_struct as well as task_struct. The run_posix_cpu_timers() function
    uses those fields to make its decisions.

    We define a new structure, "task_cputime," to contain user, system and
    scheduler times and use these in appropriate places:

    struct task_cputime {
    cputime_t utime;
    cputime_t stime;
    unsigned long long sum_exec_runtime;
    };

    This is included in the structure "thread_group_cputime," which is a new
    substructure of signal_struct and which varies for uniprocessor versus
    multiprocessor kernels. For uniprocessor kernels, it uses "task_cputime" as
    a simple substructure, while for multiprocessor kernels it is a pointer:

    struct thread_group_cputime {
    struct task_cputime totals;
    };

    struct thread_group_cputime {
    struct task_cputime *totals;
    };

    We also add a new task_cputime substructure directly to signal_struct, to
    cache the earliest expiration of process-wide timers, and task_cputime also
    replaces the it_*_expires fields of task_struct (used for earliest expiration
    of thread timers). The "thread_group_cputime" structure contains process-wide
    timers that are updated via account_user_time() and friends. In the non-SMP
    case the structure is a simple aggregator; unfortunately in the SMP case that
    simplicity was not achievable due to cache-line contention between CPUs (in
    one measured case performance was actually _worse_ on a 16-cpu system than
    the same test on a 4-cpu system, due to this contention). For SMP, the
    thread_group_cputime counters are maintained as a per-cpu structure allocated
    using alloc_percpu(). The timer functions update only the timer field in
    the structure corresponding to the running CPU, obtained using per_cpu_ptr().

    We define a set of inline functions in sched.h that we use to maintain the
    thread_group_cputime structure and hide the differences between UP and SMP
    implementations from the rest of the kernel. The thread_group_cputime_init()
    function initializes the thread_group_cputime structure for the given task.
    The thread_group_cputime_alloc() is a no-op for UP; for SMP it calls the
    out-of-line function thread_group_cputime_alloc_smp() to allocate and fill
    in the per-cpu structures and fields. The thread_group_cputime_free()
    function, also a no-op for UP, in SMP frees the per-cpu structures. The
    thread_group_cputime_clone_thread() function (also a UP no-op) for SMP calls
    thread_group_cputime_alloc() if the per-cpu structures haven't yet been
    allocated. The thread_group_cputime() function fills the task_cputime
    structure it is passed with the contents of the thread_group_cputime fields;
    in UP it's that simple but in SMP it must also safely check that tsk->signal
    is non-NULL (if it is it just uses the appropriate fields of task_struct) and,
    if so, sums the per-cpu values for each online CPU. Finally, the three
    functions account_group_user_time(), account_group_system_time() and
    account_group_exec_runtime() are used by timer functions to update the
    respective fields of the thread_group_cputime structure.

    Non-SMP operation is trivial and will not be mentioned further.

    The per-cpu structure is always allocated when a task creates its first new
    thread, via a call to thread_group_cputime_clone_thread() from copy_signal().
    It is freed at process exit via a call to thread_group_cputime_free() from
    cleanup_signal().

    All functions that formerly summed utime/stime/sum_sched_runtime values from
    from all threads in the thread group now use thread_group_cputime() to
    snapshot the values in the thread_group_cputime structure or the values in
    the task structure itself if the per-cpu structure hasn't been allocated.

    Finally, the code in kernel/posix-cpu-timers.c has changed quite a bit.
    The run_posix_cpu_timers() function has been split into a fast path and a
    slow path; the former safely checks whether there are any expired thread
    timers and, if not, just returns, while the slow path does the heavy lifting.
    With the dedicated thread group fields, timers are no longer "rebalanced" and
    the process_timer_rebalance() function and related code has gone away. All
    summing loops are gone and all code that used them now uses the
    thread_group_cputime() inline. When process-wide timers are set, the new
    task_cputime structure in signal_struct is used to cache the earliest
    expiration; this is checked in the fast path.

    Performance

    The fix appears not to add significant overhead to existing operations. It
    generally performs the same as the current code except in two cases, one in
    which it performs slightly worse (Case 5 below) and one in which it performs
    very significantly better (Case 2 below). Overall it's a wash except in those
    two cases.

    I've since done somewhat more involved testing on a dual-core Opteron system.

    Case 1: With no itimer running, for a test with 100,000 threads, the fixed
    kernel took 1428.5 seconds, 513 seconds more than the unfixed system,
    all of which was spent in the system. There were twice as many
    voluntary context switches with the fix as without it.

    Case 2: With an itimer running at .01 second ticks and 4000 threads (the most
    an unmodified kernel can handle), the fixed kernel ran the test in
    eight percent of the time (5.8 seconds as opposed to 70 seconds) and
    had better tick accuracy (.012 seconds per tick as opposed to .023
    seconds per tick).

    Case 3: A 4000-thread test with an initial timer tick of .01 second and an
    interval of 10,000 seconds (i.e. a timer that ticks only once) had
    very nearly the same performance in both cases: 6.3 seconds elapsed
    for the fixed kernel versus 5.5 seconds for the unfixed kernel.

    With fewer threads (eight in these tests), the Case 1 test ran in essentially
    the same time on both the modified and unmodified kernels (5.2 seconds versus
    5.8 seconds). The Case 2 test ran in about the same time as well, 5.9 seconds
    versus 5.4 seconds but again with much better tick accuracy, .013 seconds per
    tick versus .025 seconds per tick for the unmodified kernel.

    Since the fix affected the rlimit code, I also tested soft and hard CPU limits.

    Case 4: With a hard CPU limit of 20 seconds and eight threads (and an itimer
    running), the modified kernel was very slightly favored in that while
    it killed the process in 19.997 seconds of CPU time (5.002 seconds of
    wall time), only .003 seconds of that was system time, the rest was
    user time. The unmodified kernel killed the process in 20.001 seconds
    of CPU (5.014 seconds of wall time) of which .016 seconds was system
    time. Really, though, the results were too close to call. The results
    were essentially the same with no itimer running.

    Case 5: With a soft limit of 20 seconds and a hard limit of 2000 seconds
    (where the hard limit would never be reached) and an itimer running,
    the modified kernel exhibited worse tick accuracy than the unmodified
    kernel: .050 seconds/tick versus .028 seconds/tick. Otherwise,
    performance was almost indistinguishable. With no itimer running this
    test exhibited virtually identical behavior and times in both cases.

    In times past I did some limited performance testing. those results are below.

    On a four-cpu Opteron system without this fix, a sixteen-thread test executed
    in 3569.991 seconds, of which user was 3568.435s and system was 1.556s. On
    the same system with the fix, user and elapsed time were about the same, but
    system time dropped to 0.007 seconds. Performance with eight, four and one
    thread were comparable. Interestingly, the timer ticks with the fix seemed
    more accurate: The sixteen-thread test with the fix received 149543 ticks
    for 0.024 seconds per tick, while the same test without the fix received 58720
    for 0.061 seconds per tick. Both cases were configured for an interval of
    0.01 seconds. Again, the other tests were comparable. Each thread in this
    test computed the primes up to 25,000,000.

    I also did a test with a large number of threads, 100,000 threads, which is
    impossible without the fix. In this case each thread computed the primes only
    up to 10,000 (to make the runtime manageable). System time dominated, at
    1546.968 seconds out of a total 2176.906 seconds (giving a user time of
    629.938s). It received 147651 ticks for 0.015 seconds per tick, still quite
    accurate. There is obviously no comparable test without the fix.

    Signed-off-by: Frank Mayhar
    Cc: Roland McGrath
    Cc: Alexey Dobriyan
    Cc: Andrew Morton
    Signed-off-by: Ingo Molnar

    Frank Mayhar
     
  • * master.kernel.org:/home/rmk/linux-2.6-arm:
    [ARM] Fix PCI_DMA_BUS_IS_PHYS for ARM
    [ARM] 5247/1: tosa: SW_EAR_IN support
    [ARM] 5246/1: tosa: add proper clock alias for tc6393xb clock
    [ARM] 5245/1: Fix warning about unused return value in drivers/pcmcia
    [ARM] OMAP: Fix MMC device data
    imx serial: fix rts handling for non imx1 based hardware
    imx serial: set RXD mux bit on i.MX27 and i.MX31
    i.MX serial: fix init failure
    pcm037: add rts/cts support for serial port

    Linus Torvalds
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    [libata] LBA28/LBA48 off-by-one bug in ata.h
    sata_inic162x: enable LED blinking
    ata: duplicate variable sparse warning

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI: re-add debug prints for unmodified BARs
    PCI: fix pciehp_free_irq()
    PCI Hotplug: fakephp: fix deadlock... again
    PCI: Fix printk warnings in setup-bus.c
    PCI: Fix printk warnings in probe.c
    PCI/iommu: blacklist DMAR on Intel G31/G33 chipsets

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    niu: panic on reset
    netlink: fix overrun in attribute iteration
    [Bluetooth] Fix regression from using default link policy
    ath9k: Assign seq# when mac80211 requests this

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
    sparc: Fix user_regset 'n' field values.
    sparc64: Fix PCI error interrupt registry on PSYCHO.
    sparc32: Fix function signature of of_bus_sbus_get_flags().
    sparc64: Fix interrupt register calculations on Psycho and Sabre.

    Linus Torvalds
     
  • - 8-bit interface mode never worked properly. The only adapter I have
    which supports the 8b mode (the Jmicron) had some problems with its
    clock wiring and they discovered it only now. We also discovered that
    ProHG media is more sensitive to the ordering of initialization
    commands.

    - Make the driver fall back to highest supported mode instead of always
    falling back to serial. The driver will attempt the switch to 8b mode
    for any new MSPro card, but not all of them support it. Previously,
    these new cards ended up in serial mode, which is not the best idea
    (they work fine with 4b, after all).

    - Edit some macros for better conformance to Sony documentation

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

    Alex Dubov
     
  • Herton Krzesinski reports that the error-checking changes in
    04ebd4aee52b06a2c38127d9208546e5b96f3a19 ("block/ioctl.c and
    fs/partition/check.c: check value returned by add_partition") cause his
    buggy USB camera to no longer mount. "The camera is an Olympus X-840.
    The original issue comes from the camera itself: its format program
    creates a partition with an off by one error".

    Buggy devices happen. It is better for the kernel to warn and to proceed
    with the mount.

    Reported-by: Herton Ronaldo Krzesinski
    Cc: Abdel Benamrouche
    Cc: Jens Axboe
    Cc: Alan Stern
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Fix the section mismatch warning generated by the incorrect naming of
    s3c24xx_spidrv which should be s3c24xx_spi_driver:

    WARNING: drivers/spi/spi_s3c24xx.o(.data+0x4):
    Section mismatch in reference from the variable s3c24xx_spidrv
    to the (unknown reference) .exit.text:(unknown)

    Signed-off-by: Ben Dooks
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     
  • When suspending the system with atmel_lcdfb enabled, I sometimes see
    this:

    atmel_lcdfb atmel_lcdfb.0: FIFO underflow 0x10

    Which can be explained by the fact that we're not stopping the LCD
    controller and its DMA engine when suspending, we're just gating the
    clocks to them.

    There's another potential issue which may be harder to trigger but
    much more nasty: If we gate the clocks at _just_ the right moment,
    e.g. when the DMA engine is doing a bus transaction, we may cause the
    DMA engine to violate the system bus protocol and cause a lockup.

    Avoid these issues by shutting down the LCD controller before entering
    suspend (and restarting it when resuming). This prevents the underrun
    from happening in the first place, and prevents whatever nastiness is
    happening when the bus clock stops in the middle of a DMA transfer.

    Signed-off-by: Haavard Skinnemoen
    Acked-by: Nicolas Ferre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haavard Skinnemoen
     
  • If you are on ia64 and you modprobe xpc then modprobe -r xpc, you
    immediately get a panic. xpc depends on xp which depends on gru for a
    symbol. That symbol is only used when we are running on UV hardware.

    Currently, the GRU driver detects we are not on UV hardware and does no
    initializing. It does not do the same check when unloading. As a result,
    the gru driver attempts to tear down stuff that was not setup.

    This is a simple two-line workaround to get us through this release. Once
    2.6.28 is opened, we need to rework the symbols that xp is depending on
    from gru so the gru driver can properly fail to load when hardware is not
    available.

    Signed-off-by: Robin Holt
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robin Holt
     
  • It should be linux-uvc-devel@lists.berlios.de.

    Signed-off-by: Ming Lei
    Cc: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ming Lei
     
  • Provide summary ABI docs about the /sys/class/gpio files.

    Signed-off-by: David Brownell
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • The iterator for_each_zone_zonelist() uses a struct zoneref *z cursor when
    scanning zonelists to keep track of where in the zonelist it is. The
    zoneref that is returned corresponds to the the next zone that is to be
    scanned, not the current one. It was intended to be treated as an opaque
    list.

    When the page allocator is scanning a zonelist, it marks elements in the
    zonelist corresponding to zones that are temporarily full. As the
    zonelist is being updated, it uses the cursor here;

    if (NUMA_BUILD)
    zlc_mark_zone_full(zonelist, z);

    This is intended to prevent rescanning in the near future but the zoneref
    cursor does not correspond to the zone that has been found to be full.
    This is an easy misunderstanding to make so this patch corrects the
    problem by changing zoneref cursor to be the current zone being scanned
    instead of the next one.

    Signed-off-by: Mel Gorman
    Cc: Andy Whitcroft
    Cc: KAMEZAWA Hiroyuki
    Cc: [2.6.26.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Fixes two DMA bugs in the pxa2xx_spi driver. The first bug is in all
    versions of this driver; the second was introduced in the 2.6.20 kernel,
    and prevents using the driver with chips like m25p16 flash (which can
    issue large DMA reads).

    1. Zero length transfers are permitted for use to insert timing,
    but pxa2xx_spi.c will fail if this is requested in DMA mode.
    Fixed by using programmed I/O (PIO) mode for such transfers.

    2. Transfers larger than 8191 are not permitted in DMA mode. A
    test for length rejects all large transfers regardless of DMA
    or PIO mode. Worked around by rejecting only large transfers
    with DMA mapped buffers, and forcing all other transfers
    larger than 8191 to use PIO mode. A rate limited warning is
    issued for DMA transfers forced to PIO mode.

    This patch should apply to all kernels back to and including 2.6.20;
    it was test patched against 2.6.20. An additional patch would be
    required for older kernels, but those versions are very buggy anyway.

    Signed-off-by: Ned Forrester
    Cc: Vernon Sauder
    Cc: Eric Miao
    Signed-off-by: David Brownell
    Cc: [2.6.25.x, 2.6.26.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ned Forrester
     
  • Fixes several chipselect bugs in the pxa2xx_spi driver. These bugs are in
    all versions of this driver and prevent using it with chips like m25p16
    flash.

    1. The spi_transfer.cs_change flag is handled too early:
    before spi_transfer.delay_usecs applies, thus making the
    delay ineffective at holding chip select.

    2. spi_transfer.delay_usecs is ignored on the last transfer
    of a message (likewise not holding chipselect long enough).

    3. If spi_transfer.cs_change is set on the last transfer, the
    chip select is always disabled, instead of the intended
    meaning: optionally holding chip select enabled for the
    next message.

    Those first three bugs were fixed with a relocation of delays
    and chip select de-assertions.

    4. If a message has the cs_change flag set on the last transfer,
    and had the chip select stayed enabled as requested (see 3,
    above), it would not have been disabled if the next message is
    for a different chip. Fixed by dropping chip select regardless
    of cs_change at end of a message, if there is no next message
    or if the next message is for a different chip.

    This patch should apply to all kernels back to and including 2.6.20;
    it was test patched against 2.6.20. An additional patch would be
    required for older kernels, but those versions are very buggy anyway.

    Signed-off-by: Ned Forrester
    Cc: Vernon Sauder
    Cc: Eric Miao
    Signed-off-by: David Brownell
    Cc: [2.6.25.x, 2.6.26.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ned Forrester
     
  • Error out on transfer length != multiple of bytes per word with -EINVAL.
    Fixes a buffer overrun crash if length < bytes per word.

    Signed-off-by: Peter Korsgaard
    Acked-by: Joakim Tjernlund
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     
  • Commit a61f5345 (spi_mpc83xx clockrate fixes) broke clockrate calculation
    for low speeds. SPMODE_DIV16 should be set if the divider is higher than
    64, not only if the divider gets clipped to 1024.

    Furthermore, the clipping check was off by a factor 16 as well.

    Signed-off-by: Peter Korsgaard
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     
  • A "Quicklists: 0 kB" line has just started appearing in
    /proc/meminfo, but most architectures (including x86) don't have
    them configured, so #ifdef it, like the highmem lines.

    And those architectures which do have quicklists configured are
    using them for page tables: so let's place it next to PageTables.

    Signed-off-by: Hugh Dickins
    Acked-by: Christoph Lameter
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • This fixes:

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.27-rc5-00283-g70bb089 #68
    ---------------------------------------------
    touch/6855 is trying to acquire lock:
    (&info->bfs_lock){--..}, at: [] bfs_delete_inode+0x9e/0x18c

    but task is already holding lock:
    (&info->bfs_lock){--..}, at: [] bfs_create+0x45/0x187

    other info that might help us debug this:
    2 locks held by touch/6855:
    #0: (&type->i_mutex_dir_key#5){--..}, at: [] do_filp_open+0x10b/0x62f
    #1: (&info->bfs_lock){--..}, at: [] bfs_create+0x45/0x187

    stack backtrace:
    Pid: 6855, comm: touch Not tainted 2.6.27-rc5-00283-g70bb089 #68
    [] validate_chain+0x458/0x9f4
    [] ? trace_hardirqs_off+0xb/0xd
    [] __lock_acquire+0x666/0x6e0
    [] lock_acquire+0x5b/0x77
    [] ? bfs_delete_inode+0x9e/0x18c
    [] mutex_lock_nested+0xbc/0x234
    [] ? bfs_delete_inode+0x9e/0x18c
    [] ? bfs_delete_inode+0x9e/0x18c
    [] bfs_delete_inode+0x9e/0x18c
    [] ? bfs_delete_inode+0x0/0x18c
    [] generic_delete_inode+0x94/0xfe
    [] generic_drop_inode+0x12/0x12f
    [] iput+0x4b/0x4e
    [] bfs_create+0x163/0x187
    [] vfs_create+0xa6/0x114
    [] do_filp_open+0x1ad/0x62f
    [] ? native_sched_clock+0x82/0x96
    [] ? _spin_unlock+0x27/0x3c
    [] ? alloc_fd+0xbf/0xc9
    [] ? sub_preempt_count+0x9d/0xab
    [] ? alloc_fd+0xbf/0xc9
    [] do_sys_open+0x42/0xb8
    [] ? trace_hardirqs_on_thunk+0xc/0x10
    [] sys_open+0x1e/0x26
    [] sysenter_do_call+0x12/0x31
    =======================

    The problem is that we don't unlock the bfs->lock mutex before calling
    iput (we do in the other cases).

    Signed-off-by: Eric Sesterhenn
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     
  • There is no description of bit 4 of coredump_filter in the
    documentation. This patch adds it.

    Signed-off-by: Hidehiro Kawai
    Cc: Roland McGrath
    Cc: Mel Gorman
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hidehiro Kawai
     
  • If all the cpus in a cpuset are offlined, the tasks in it will be moved to
    the nearest ancestor with non-empty cpus.

    Signed-off-by: Li Zefan
    Acked-by: Paul Jackson
    Cc: Paul Menage
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • After the patch:

    commit 0b2f630a28d53b5a2082a5275bc3334b10373508
    Author: Miao Xie
    Date: Fri Jul 25 01:47:21 2008 -0700

    cpusets: restructure the function update_cpumask() and update_nodemask()

    It might happen that 'echo 0 > /cpuset/sub/cpus' returned failure but 'cpus'
    has been changed, because cpus was changed before calling heap_init() which
    may return -ENOMEM.

    This patch restores the orginal behavior.

    Signed-off-by: Li Zefan
    Acked-by: Paul Menage
    Cc: Paul Jackson
    Cc: Miao Xie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • akpm: these have no callers at this time, but they shall soon, so let's
    get them right.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Hiroshi DOYU
    Cc: Tony Lindgren
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hiroshi DOYU
     
  • Print parent directory name as well.

    The aim is to catch non-creation of parent directory when proc_mkdir will
    return NULL and all subsequent registrations go directly in /proc instead
    of intended directory.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    [ Fixed insane printk string while at it. - Linus ]
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • I recently bought 3 HGST P7K500-series 500GB SATA drives and
    had trouble accessing the block right on the LBA28-LBA48 border.
    Here's how it fails (same for all 3 drives):

    # dd if=/dev/sdc bs=512 count=1 skip=268435455 > /dev/null
    dd: reading `/dev/sdc': Input/output error
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 0.288033 seconds, 0.0 kB/s
    # dmesg
    ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
    ata1.00: BMDMA stat 0x25
    ata1.00: cmd c8/00:08:f8:ff:ff/00:00:00:00:00/ef tag 0 dma 4096 in
    res 51/04:08:f8:ff:ff/00:00:00:00:00/ef Emask 0x1 (device error)
    ata1.00: status: { DRDY ERR }
    ata1.00: error: { ABRT }
    ata1.00: configured for UDMA/33
    ata1: EH complete
    ...

    After some investigations, it turned out this seems to be caused
    by misinterpretation of the ATA specification on LBA28 access.
    Following part is the code in question:

    === include/linux/ata.h ===
    static inline int lba_28_ok(u64 block, u32 n_block)
    {
    /* check the ending block number */
    return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block From the ATA specification:
    (http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf)

    8.15.29 Word (61:60): Total number of user addressable sectors
    This field contains a value that is one greater than the total number
    of user addressable sectors (see 6.2). The maximum value that shall
    be placed in this field is 0FFFFFFFh.

    So the driver shouldn't use the value of 0xfffffff for LBA28 request
    as this exceeds maximum user addressable sector. The logical maximum
    value for LBA28 is 0xffffffe.

    The obvious fix is to cut "- 1" part, and the patch attached just do
    that. I've been using the patched kernel for about a month now, and
    the same fix is also floating on the net for some time. So I believe
    this fix works reliably.

    Just FYI, many Windows/Intel platform users also seems to be struck
    by this, and HGST has issued a note pointing to Intel ICH8/9 driver.

    "28-bit LBA command is being used to access LBAs 29-bits in length"
    http://www.hitachigst.com/hddt/knowtree.nsf/cffe836ed7c12018862565b000530c74/b531b8bce8745fb78825740f00580e23

    Also, *BSDs seems to have similar fix included sometime around ~2004,
    through I have not checked out exact portion of the code.

    Signed-off-by: Taisuke Yamada
    Signed-off-by: Jeff Garzik

    Taisuke Yamada
     
  • Enable LED blinking.

    Signed-off-by: Bob Stewart
    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Bob Stewart
     
  • drivers/ata/ata_piix.c:1502:7: warning: symbol 'rc' shadows an earlier one

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Jeff Garzik

    Stephen Hemminger
     
  • PCI_DMA_BUS_IS_PHYS was defined to be zero, which meant we ignored
    the DMA mask for IDE and SCSI transfers. This is wrong - we have
    no DMA translation hardware. We want to obey DMA masks so that the
    block layer performs bouncing itself.

    Reported-by: Mikael Pettersson
    Signed-off-by: Russell King

    Russell King
     
  • Russell King
     
  • Signed-off-by: Dmitry Baryshkov
    Acked-by: Eric Miao
    Signed-off-by: Russell King

    Dmitry Baryshkov