10 Sep, 2010

40 commits

  • When under significant memory pressure, a process enters direct reclaim
    and immediately afterwards tries to allocate a page. If it fails and no
    further progress is made, it's possible the system will go OOM. However,
    on systems with large amounts of memory, it's possible that a significant
    number of pages are on per-cpu lists and inaccessible to the calling
    process. This leads to a process entering direct reclaim more often than
    it should increasing the pressure on the system and compounding the
    problem.

    This patch notes that if direct reclaim is making progress but allocations
    are still failing that the system is already under heavy pressure. In
    this case, it drains the per-cpu lists and tries the allocation a second
    time before continuing.

    Signed-off-by: Mel Gorman
    Reviewed-by: Minchan Kim
    Reviewed-by: KAMEZAWA Hiroyuki
    Reviewed-by: KOSAKI Motohiro
    Reviewed-by: Christoph Lameter
    Cc: Dave Chinner
    Cc: Wu Fengguang
    Cc: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • …low and kswapd is awake

    Ordinarily watermark checks are based on the vmstat NR_FREE_PAGES as it is
    cheaper than scanning a number of lists. To avoid synchronization
    overhead, counter deltas are maintained on a per-cpu basis and drained
    both periodically and when the delta is above a threshold. On large CPU
    systems, the difference between the estimated and real value of
    NR_FREE_PAGES can be very high. If NR_FREE_PAGES is much higher than
    number of real free page in buddy, the VM can allocate pages below min
    watermark, at worst reducing the real number of pages to zero. Even if
    the OOM killer kills some victim for freeing memory, it may not free
    memory if the exit path requires a new page resulting in livelock.

    This patch introduces a zone_page_state_snapshot() function (courtesy of
    Christoph) that takes a slightly more accurate view of an arbitrary vmstat
    counter. It is used to read NR_FREE_PAGES while kswapd is awake to avoid
    the watermark being accidentally broken. The estimate is not perfect and
    may result in cache line bounces but is expected to be lighter than the
    IPI calls necessary to continually drain the per-cpu counters while kswapd
    is awake.

    Signed-off-by: Christoph Lameter <cl@linux.com>
    Signed-off-by: Mel Gorman <mel@csn.ul.ie>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Christoph Lameter
     
  • When allocating a page, the system uses NR_FREE_PAGES counters to
    determine if watermarks would remain intact after the allocation was made.
    This check is made without interrupts disabled or the zone lock held and
    so is race-prone by nature. Unfortunately, when pages are being freed in
    batch, the counters are updated before the pages are added on the list.
    During this window, the counters are misleading as the pages do not exist
    yet. When under significant pressure on systems with large numbers of
    CPUs, it's possible for processes to make progress even though they should
    have been stalled. This is particularly problematic if a number of the
    processes are using GFP_ATOMIC as the min watermark can be accidentally
    breached and in extreme cases, the system can livelock.

    This patch updates the counters after the pages have been added to the
    list. This makes the allocator more cautious with respect to preserving
    the watermarks and mitigates livelock possibilities.

    [akpm@linux-foundation.org: avoid modifying incoming args]
    Signed-off-by: Mel Gorman
    Reviewed-by: Rik van Riel
    Reviewed-by: Minchan Kim
    Reviewed-by: KAMEZAWA Hiroyuki
    Reviewed-by: Christoph Lameter
    Reviewed-by: KOSAKI Motohiro
    Acked-by: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • refresh_zone_stat_thresholds() calculates parameter based on the number of
    online cpus. It's called at cpu offlining but needs to be called at
    onlining, too.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Christoph Lameter
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • O_NONBLOCK on parisc has a dual value:

    #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */

    It is caught by the O_* bits uniqueness check and leads to a parisc
    compile error. The fix would be to take O_NONBLOCK out.

    Signed-off-by: Wu Fengguang
    Signed-off-by: James Bottomley
    Cc: Jamie Lokier
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • Tests with recent firmware on Intel X25-M 80GB and OCZ Vertex 60GB SSDs
    show a shift since I last tested in December: in part because of firmware
    updates, in part because of the necessary move from barriers to awaiting
    completion at the block layer. While discard at swapon still shows as
    slightly beneficial on both, discarding 1MB swap cluster when allocating
    is now disadvanteous: adds 25% overhead on Intel, adds 230% on OCZ (YMMV).

    Surrender: discard as presently implemented is more hindrance than help
    for swap; but might prove useful on other devices, or with improvements.
    So continue to do the discard at swapon, but make discard while swapping
    conditional on a SWAP_FLAG_DISCARD to sys_swapon() (which has been using
    only the lower 16 bits of int flags).

    We can add a --discard or -d to swapon(8), and a "discard" to swap in
    /etc/fstab: matching the mount option for btrfs, ext4, fat, gfs2, nilfs2.

    Signed-off-by: Hugh Dickins
    Cc: Christoph Hellwig
    Cc: Nigel Cunningham
    Cc: Tejun Heo
    Cc: Jens Axboe
    Cc: James Bottomley
    Cc: "Martin K. Petersen"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • The swap code already uses synchronous discards, no need to add I/O
    barriers.

    This fixes the worst of the terrible slowdown in swap allocation for
    hibernation, reported on 2.6.35 by Nigel Cunningham; but does not entirely
    eliminate that regression.

    [tj@kernel.org: superflous newlines removed]
    Signed-off-by: Christoph Hellwig
    Tested-by: Nigel Cunningham
    Signed-off-by: Tejun Heo
    Signed-off-by: Hugh Dickins
    Cc: Jens Axboe
    Cc: James Bottomley
    Cc: "Martin K. Petersen"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Move the hibernation check from scan_swap_map() into try_to_free_swap():
    to catch not only the common case when hibernation's allocation itself
    triggers swap reuse, but also the less likely case when concurrent page
    reclaim (shrink_page_list) might happen to try_to_free_swap from a page.

    Hibernation already clears __GFP_IO from the gfp_allowed_mask, to stop
    reclaim from going to swap: check that to prevent swap reuse too.

    Signed-off-by: Hugh Dickins
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: "Rafael J. Wysocki"
    Cc: Ondrej Zary
    Cc: Andrea Gelmini
    Cc: Balbir Singh
    Cc: Andrea Arcangeli
    Cc: Nigel Cunningham
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Please revert 2.6.36-rc commit d2997b1042ec150616c1963b5e5e919ffd0b0ebf
    "hibernation: freeze swap at hibernation". It complicated matters by
    adding a second swap allocation path, just for hibernation; without in any
    way fixing the issue that it was intended to address - page reclaim after
    fixing the hibernation image might free swap from a page already imaged as
    swapcache, letting its swap be reallocated to store a different page of
    the image: resulting in data corruption if the imaged page were freed as
    clean then swapped back in. Pages freed to si->swap_map were still in
    danger of being reallocated by the alternative allocation path.

    I guess it inadvertently fixed slow SSD swap allocation for hibernation,
    as reported by Nigel Cunningham: by missing out the discards that occur on
    the usual swap allocation path; but that was unintentional, and needs a
    separate fix.

    Signed-off-by: Hugh Dickins
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: "Rafael J. Wysocki"
    Cc: Ondrej Zary
    Cc: Andrea Gelmini
    Cc: Balbir Singh
    Cc: Andrea Arcangeli
    Cc: Nigel Cunningham
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • I have been seeing problems on Tegra 2 (ARMv7 SMP) systems with HIGHMEM
    enabled on 2.6.35 (plus some patches targetted at 2.6.36 to perform cache
    maintenance lazily), and the root cause appears to be that the mm bouncing
    code is calling flush_dcache_page before it copies the bounce buffer into
    the bio.

    The bounced page needs to be flushed after data is copied into it, to
    ensure that architecture implementations can synchronize instruction and
    data caches if necessary.

    Signed-off-by: Gary King
    Cc: Tejun Heo
    Cc: Russell King
    Acked-by: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gary King
     
  • It was a mistake to mark the PL031 IRQ as shared (for the U8500),
    we misread the datasheet. Get rid of this.

    Signed-off-by: Linus Walleij
    Cc: Jonas Aberg
    Cc: Mian Yousaf Kaukab
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linus Walleij
     
  • Because no one dared to remove it so far, let's keep the entry correct, at
    least.

    Signed-off-by: Wolfram Sang
    Acked-by: Mike Frysinger
    Cc: Paul Gortmaker
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • There's been some recent confusion about error checking GPIO numbers.
    briefly, it should be handled mostly during setup, when gpio_request() is
    called, and NEVER by expectig gpio_is_valid to report more than
    never-usable GPIO numbers.

    [akpm@linux-foundation.org: terminate unterminated comment]
    Signed-off-by: David Brownell
    Cc: Eric Miao"
    Cc: "Ryan Mallon"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • Replace the arbitrary software-reset call from the device-probe
    method, because:

    - It is defective. To work correctly, it should be two byte writes,
    not a single word write. As it stands, it does nothing.

    - Some devices with sx150x expanders installed have their NRESET pins
    ganged on the same line, so resetting one causes the others to reset -
    not a nice thing to do arbitrarily!

    - The probe, usually taking place at boot, implies a recent hard-reset,
    so a software reset at this point is just a waste of energy anyway.

    Therefore, make it optional, defaulting to off, as this will match the
    common case of probing at powerup and also matches the current broken
    no-op behavior.

    Signed-off-by: Gregory Bean
    Reviewed-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gregory Bean
     
  • next_active_pageblock() is for finding next _used_ freeblock. It skips
    several blocks when it finds there are a chunk of free pages lager than
    pageblock. But it has 2 bugs.

    1. We have no lock. page_order(page) - pageblock_order can be minus.
    2. pageblocks_stride += is wrong. it should skip page_order(p) of pages.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Michal Hocko
    Cc: Wu Fengguang
    Cc: Mel Gorman
    Cc: KAMEZAWA Hiroyuki
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Iram reported that compaction's too_many_isolated() loops forever.
    (http://www.spinics.net/lists/linux-mm/msg08123.html)

    The meminfo when the situation happened was inactive anon is zero. That's
    because the system has no memory pressure until then. While all anon
    pages were in the active lru, compaction could select active lru as well
    as inactive lru. That's a different thing from vmscan's isolated. So we
    has been two too_many_isolated.

    While compaction can isolate pages in both active and inactive, current
    implementation of too_many_isolated only considers inactive. It made
    Iram's problem.

    This patch handles active and inactive fairly. That's because we can't
    expect where from and how many compaction would isolated pages.

    This patch changes (nr_isolated > nr_inactive) with
    nr_isolated > (nr_active + nr_inactive) / 2.

    Signed-off-by: Minchan Kim
    Reported-by: Iram Shahzad
    Acked-by: Mel Gorman
    Acked-by: Wu Fengguang
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • gid_t is a unsigned int. If group_info contains a gid greater than
    MAX_INT, groups_search() function may look on the wrong side of the search
    tree.

    This solves some unfair "permission denied" problems.

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

    Jerome Marchand
     
  • The slab.h header is required to use the kmalloc() family of functions.
    Due to recent kernel changes, this header must be directly included by
    code that calls into the memory allocator.

    Without this patch, any code which includes this header fails to build.

    Signed-off-by: Ira W. Snyder
    Cc: Dan Williams
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ira W. Snyder
     
  • Commit b485fe5ea ("rtc/m41t80: use rtc_valid_tm() to check returned tm")
    added rtc_valid_tm to m41t80_rtc_read_alarm() but it was wrong while the
    t->time does not contain complete date/time.

    This patch also fixes a warning:
    warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type

    Signed-off-by: Atsushi Nemoto
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     
  • Commit 74641f584da ("alpha: binfmt_aout fix") (May 2009) introduced a
    regression - binfmt_misc is now consulted after binfmt_elf, which will
    unfortunately break ia32el. ia32 ELF binaries on ia64 used to be matched
    using binfmt_misc and executed using wrapper. As 32bit binaries are now
    matched by binfmt_elf before bindmt_misc kicks in, the wrapper is ignored.

    The fix increases precedence of binfmt_misc to the original state.

    Signed-off-by: Jan Sembera
    Cc: Ivan Kokshaysky
    Cc: Al Viro
    Cc: Richard Henderson [2.6.everything.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Sembera
     
  • COMPACTION enables MIGRATION, but MIGRATION spawns a warning if numa or
    memhotplug aren't selected. However MIGRATION doesn't depend on them. I
    guess it's just trying to be strict doing a double check on who's enabling
    it, but it doesn't know that compaction also enables MIGRATION.

    Signed-off-by: Andrea Arcangeli
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • The pte_same check is reliable only if the swap entry remains pinned (by
    the page lock on swapcache). We've also to ensure the swapcache isn't
    removed before we take the lock as try_to_free_swap won't care about the
    page pin.

    One of the possible impacts of this patch is that a KSM-shared page can
    point to the anon_vma of another process, which could exit before the page
    is freed.

    This can leave a page with a pointer to a recycled anon_vma object, or
    worse, a pointer to something that is no longer an anon_vma.

    [riel@redhat.com: changelog help]
    Signed-off-by: Andrea Arcangeli
    Acked-by: Hugh Dickins
    Reviewed-by: Rik van Riel
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • Move the second if (reg & ...) test into the branch indicated by its
    indentation. The test was previously always executed after the if
    containing that branch, but it was always false unless the if branch was
    taken.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable braces4@
    position p1,p2;
    statement S1,S2;
    @@

    (
    if (...) { ... }
    |
    if (...) S1@p1 S2@p2
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    if (p1[0].column == p2[0].column):
    cocci.print_main("branch",p1)
    cocci.print_secs("after",p2)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Chris Ball
    Cc: Pavel Pisa
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • If suspend called when kmmcd is doing host->ops->disable, as kmmcd already
    increased host->en_dis_recurs to 1, the mmc_host_enable in suspend
    function will return directly without increase the nesting_cnt, which will
    cause the followed register access carried out to the disabled host.

    mmc_suspend_host will enable host itself. No need to enable host before
    it. Also works on kmmcd will get flushed in mmc_suspend_host, enable host
    after it will be safe. So make the mmc_host_enable after it.

    [cjb: rebase against current Linus]
    Signed-off-by: Ethan
    Signed-off-by: Chris Ball
    Acked-by: Adrian Hunter
    Acked-by: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ethan Du
     
  • Fix the following error:

    at91_mci.c: In function 'at91_mci_sg_to_dma':
    at91_mci.c:236: error: implicit declaration of function 'kmap_atomic'
    at91_mci.c:236: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function)
    at91_mci.c:236: error: (Each undeclared identifier is reported only once
    at91_mci.c:236: error: for each function it appears in.)
    at91_mci.c:236: warning: assignment makes pointer from integer without a cast
    at91_mci.c:252: error: implicit declaration of function 'kunmap_atomic'
    at91_mci.c: In function 'at91_mci_post_dma_read':
    at91_mci.c:302: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function)
    at91_mci.c:302: warning: assignment makes pointer from integer without a cast
    at91_mci.c:317: error: implicit declaration of function 'flush_kernel_dcache_page'

    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Chris Ball
    Cc: Nicolas Ferre
    Cc: Andrew Victor
    Cc: Wolfgang Muees
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marc Kleine-Budde
     
  • This fixes the following warning:

    drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
    drivers/mmc/host/omap_hsmmc.c:2275: warning: unused variable 'state'

    Introduced by commit ID:

    commit 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e
    Author: Matt Fleming
    Date: Wed May 26 14:42:08 2010 -0700

    mmc: remove the "state" argument to mmc_suspend_host()

    The unique usage of this var was removed there, and missed
    removing the respective declaration aswell.

    Signed-off-by: Sergio Aguirre
    Signed-off-by: Chris Ball
    Acked-by: Matt Fleming
    Cc: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergio Aguirre
     
  • [cjb: fix line-wrapped patch]
    Signed-off-by: Jiri Pinkava
    Signed-off-by: Chris Ball
    Cc: Matt Fleming
    Cc: Russell King
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Pinkava
     
  • kunmap_atomic() takes the cookie, returned by the kmap_atomic() as its
    argument and not the page address, used as an argument to kmap_atomic().
    This patch fixes the compile error:

    In file included from drivers/mmc/host/tmio_mmc.c:37:
    drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic':
    drivers/mmc/host/tmio_mmc.h:192: error: negative width in bit-field ''

    Signed-off-by: Guennadi Liakhovetski
    Acked-by: Eric Miao
    Tested-by: Magnus Damm
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • Previously, it was possible for ack_mmc_irqs() to clear pending interrupt
    bits in the CTL_STATUS register, even though the interrupt handler had not
    been called. This was because of a race that existed when doing a
    read-modify-write sequence on CTL_STATUS. After the read step in this
    sequence, if an interrupt occurred (causing one of the bits in CTL_STATUS
    to be set) the write step would inadvertently clear it.

    Observed with the TMIO_STAT_RXRDY bit together with CMD53 on AR6002 and
    BCM4318 SDIO cards in polled mode.

    This patch eliminates this race by only writing to CTL_STATUS and clearing
    the interrupts that were passed as an argument to ack_mmc_irqs()."

    [matt@console-pimps.org: rewrote changelog]
    Signed-off-by: Yusuke Goda
    Acked-by: Magnus Damm "
    Tested-by: Arnd Hannemann "
    Acked-by: Ian Molton
    Cc: Matt Fleming
    Cc: Samuel Ortiz
    Cc: Paul Mundt
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yusuke Goda
     
  • Add cgroup_attach_task_all()

    The existing cgroup_attach_task_current_cg() API is called by a thread to
    attach another thread to all of its cgroups; this is unsuitable for cases
    where a privileged task wants to attach itself to the cgroups of a less
    privileged one, since the call must be made from the context of the target
    task.

    This patch adds a more generic cgroup_attach_task_all() API that allows
    both the source task and to-be-moved task to be specified.
    cgroup_attach_task_current_cg() becomes a specialization of the more
    generic new function.

    [menage@google.com: rewrote changelog]
    [akpm@linux-foundation.org: address reviewer comments]
    Signed-off-by: Michael S. Tsirkin
    Tested-by: Alex Williamson
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Ben Blum
    Cc: Sridhar Samudrala
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael S. Tsirkin
     
  • Fix the left-over old ifdef for PG_uncached in /proc/kpageflags. Now it's
    used by x86, too.

    Signed-off-by: Takashi Iwai
    Cc: Wu Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • The gcov-kernel infrastructure expects that each object file is loaded
    only once. This may not be true, e.g. when loading multiple kernel
    modules which are linked to the same object file. As a result, loading
    such kernel modules will result in incorrect gcov results while unloading
    will cause a null-pointer dereference.

    This patch fixes these problems by changing the gcov-kernel infrastructure
    so that multiple profiling data sets can be associated with one debugfs
    entry. It applies to 2.6.36-rc1.

    Signed-off-by: Peter Oberparleiter
    Reported-by: Werner Spies
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     
  • Kexec tools has been moved to http://kernel.org/pub/linux/utils/kernel/kexec/
    as user-space code shouldn't be in /pub/linux/kernel

    Signed-off-by: Simon Horman
    Acked-by: "Eric W. Biederman"
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Simon Horman
     
  • commit c2c6ca4 (direct-io: do not merge logically non-contiguous requests)
    introduced a bug whereby all O_DIRECT I/Os were submitted a page at a time
    to the block layer. The problem is that the code expected
    dio->block_in_file to correspond to the current page in the dio. In fact,
    it corresponds to the previous page submitted via submit_page_section.
    This was purely an oversight, as the dio->cur_page_fs_offset field was
    introduced for just this purpose. This patch simply uses the correct
    variable when calculating whether there is a mismatch between contiguous
    logical blocks and contiguous physical blocks (as described in the
    comments).

    I also switched the if conditional following this check to an else if, to
    ensure that we never call dio_bio_submit twice for the same dio (in
    theory, this should not happen, anyway).

    I've tested this by running blktrace and verifying that a 64KB I/O was
    submitted as a single I/O. I also ran the patched kernel through
    xfstests' aio tests using xfs, ext4 (with 1k and 4k block sizes) and btrfs
    and verified that there were no regressions as compared to an unpatched
    kernel.

    Signed-off-by: Jeff Moyer
    Acked-by: Josef Bacik
    Cc: Christoph Hellwig
    Cc: Chris Mason
    Cc: [2.6.35.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Moyer
     
  • Added missing axis-mapping for HP ProBook 532x and HP Mini 5102.

    Signed-off-by: Takashi Iwai
    Cc: Eric Piel
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     
  • bob.picco@hp.com doesn't work any more and Bob says that he's unlikely to
    work on hpet.c in the future.

    Signed-off-by: Jiri Slaby
    Acked-by: Bob Picco
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Much (but not all) of the RTC state is kept in the RTC peripheral which
    has its own power domain. Periodically (1 HZ), that state is synced from
    one power domain to the other (peripheral->core). When we are resuming,
    we need to wait for the sync to occur so that we don't get a mismatch of
    reading undefined state in the rest of the driver.

    Further, once the externally maintained bits have been synced back into
    the core, we then need to restore the bits maintained in the core. In our
    particular case, that is just the write completion interrupt bit.

    If we don't do any of this, working with the RTC causes ~5 second delays
    from time to time after waking up due to the write completion interrupt
    never firing.

    Reported-by: Michael Dean
    Reported-by: Michael Hennerich
    Signed-off-by: Mike Frysinger
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The int_clear helper takes a bitmask of interrupts to keep, not to
    disable. When suspending without wakeup enabled, we want to disable
    all interrupts, so use 0 (keep none) instead of -1 (keep all).

    Signed-off-by: Mike Frysinger
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Some macro parameter references inside typeof() operator are not enclosed
    with parenthesis. It should be safer to add them.

    Signed-off-by: Huang Ying
    Acked-by: Stefani Seibold
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Ying
     
  • The introduction of support for SD combo cards breaks the initialization
    of all CSR SDIO chips. The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
    chips to be reset (this is non-standard behavior).

    When initializing an SDIO card check for a combo card by using the memory
    present bit in the R4 response to IO_SEND_OP_COND (CMD5). This avoids the
    call to mmc_sd_get_cid() on an SDIO-only card.

    Signed-off-by: David Vrabel
    Acked-by: Michal Mirolaw
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Vrabel