1. 26 Jan, 2011 9 commits
    • David Rientjes's avatar
      mm: clear pages_scanned only if draining a pcp adds pages to the buddy allocator · 2ff754fa
      David Rientjes authored
      Commit 0e093d99 ("writeback: do not sleep on the congestion queue if
      there are no congested BDIs or if significant congestion is not being
      encountered in the current zone") uncovered a livelock in the page
      allocator that resulted in tasks infinitely looping trying to find
      memory and kswapd running at 100% cpu.
      
      The issue occurs because drain_all_pages() is called immediately
      following direct reclaim when no memory is freed and try_to_free_pages()
      returns non-zero because all zones in the zonelist do not have their
      all_unreclaimable flag set.
      
      When draining the per-cpu pagesets back to the buddy allocator for each
      zone, the zone->pages_scanned counter is cleared to avoid erroneously
      setting zone->all_unreclaimable later.  The problem is that no pages may
      actually be drained and, thus, the unreclaimable logic never fails
      direct reclaim so the oom killer may be invoked.
      
      This apparently only manifested after wait_iff_congested() was
      introduced and the zone was full of anonymous memory that would not
      congest the backing store.  The page allocator would infinitely loop if
      there were no other tasks waiting to be scheduled and clear
      zone->pages_scanned because of drain_all_pages() as the result of this
      change before kswapd could scan enough pages to trigger the reclaim
      logic.  Additionally, with every loop of the page allocator and in the
      reclaim path, kswapd would be kicked and would end up running at 100%
      cpu.  In this scenario, current and kswapd are all running continuously
      with kswapd incrementing zone->pages_scanned and current clearing it.
      
      The problem is even more pronounced when current swaps some of its
      memory to swap cache and the reclaimable logic then considers all active
      anonymous memory in the all_unreclaimable logic, which requires a much
      higher zone->pages_scanned value for try_to_free_pages() to return zero
      that is never attainable in this scenario.
      
      Before wait_iff_congested(), the page allocator would incur an
      unconditional timeout and allow kswapd to elevate zone->pages_scanned to
      a level that the oom killer would be called the next time it loops.
      
      The fix is to only attempt to drain pcp pages if there is actually a
      quantity to be drained.  The unconditional clearing of
      zone->pages_scanned in free_pcppages_bulk() need not be changed since
      other callers already ensure that draining will occur.  This patch
      ensures that free_pcppages_bulk() will actually free memory before
      calling into it from drain_all_pages() so zone->pages_scanned is only
      cleared if appropriate.
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Reviewed-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Reviewed-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2ff754fa
    • David Rientjes's avatar
      mm: fix deferred congestion timeout if preferred zone is not allowed · f33261d7
      David Rientjes authored
      Before 0e093d99 ("writeback: do not sleep on the congestion queue if
      there are no congested BDIs or if significant congestion is not being
      encountered in the current zone"), preferred_zone was only used for NUMA
      statistics, to determine the zoneidx from which to allocate from given
      the type requested, and whether to utilize memory compaction.
      
      wait_iff_congested(), though, uses preferred_zone to determine if the
      congestion wait should be deferred because its dirty pages are backed by
      a congested bdi.  This incorrectly defers the timeout and busy loops in
      the page allocator with various cond_resched() calls if preferred_zone
      is not allowed in the current context, usually consuming 100% of a cpu.
      
      This patch ensures preferred_zone is an allowed zone in the fastpath
      depending on whether current is constrained by its cpuset or nodes in
      its mempolicy (when the nodemask passed is non-NULL).  This is correct
      since the fastpath allocation always passes ALLOC_CPUSET when trying to
      allocate memory.  In the slowpath, this patch resets preferred_zone to
      the first zone of the allowed type when the allocation is not
      constrained by current's cpuset, i.e.  it does not pass ALLOC_CPUSET.
      
      This patch also ensures preferred_zone is from the set of allowed nodes
      when called from within direct reclaim since allocations are always
      constrained by cpusets in this context (it is blockable).
      
      Both of these uses of cpuset_current_mems_allowed are protected by
      get_mems_allowed().
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f33261d7
    • Alexander Gordeev's avatar
      pps: claim parallel port exclusively · 4f542e3d
      Alexander Gordeev authored
      Both pps_parport and pps_gen_parport are written in a way that they
      can't share a port with any other driver.  This can result in locking up
      the process that loads modules or even the whole kernel if the modules
      are compiled in.  Use PARPORT_FLAG_EXCL to indicate this.
      Signed-off-by: default avatarAlexander Gordeev <lasaine@lvk.cs.msu.su>
      Cc: Alexander Gordeev <lasaine@lvk.cs.msu.su>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4f542e3d
    • Rodolfo Giometti's avatar
      pps ktimer: remove noisy message · a783ac44
      Rodolfo Giometti authored
      Signed-off-by: default avatarRodolfo Giometti <giometti@linux.it>
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Alexander Gordeev <lasaine@lvk.cs.msu.su>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a783ac44
    • Alexander Gordeev's avatar
      parport: make lockdep happy with waitlist_lock · cbeb4b7a
      Alexander Gordeev authored
      parport_unregister_device() should never be used when interrupts are
      enabled in hardware and irq handler is registered so there is no need to
      disable interrupts when using waitlist_lock.  But there is no way to
      explain this subtle semantics to lockdep analyzer.
      
      So disable interrupts here too to simplify things.  The price is
      negligible.
      Signed-off-by: default avatarAlexander Gordeev <lasaine@lvk.cs.msu.su>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cbeb4b7a
    • Feng Tang's avatar
      langwell_gpio: modify EOI handling following change of kernel irq subsystem · 0766d20f
      Feng Tang authored
      Latest kernel has many changes in IRQ subsystem and its interfaces, like
      adding "irq_eoi" for struct irq_chip, this patch is a follow up change
      for that.
      
      Also remove the unnecessary cast for a "void *".
      Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Cc: Alek Du <alek.du@intel.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0766d20f
    • Axel Lin's avatar
      leds: leds-pwm: return proper error if pwm_request failed · d8cc667b
      Axel Lin authored
      Return PTR_ERR(led_dat->pwm) instead of 0 if pwm_request failed
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Luotao Fu <l.fu@pengutronix.de>
      Cc: Reviewed-by: Dmitry Torokhov <dtor@mail.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d8cc667b
    • Andrew Morton's avatar
      mm/pgtable-generic.c: fix CONFIG_SWAP=n build · f95ba941
      Andrew Morton authored
      mips (and sparc32):
      
        In file included from arch/mips/include/asm/tlb.h:21,
                         from mm/pgtable-generic.c:9:
        include/asm-generic/tlb.h: In function `tlb_flush_mmu':
        include/asm-generic/tlb.h:76: error: implicit declaration of function `release_pages'
        include/asm-generic/tlb.h: In function `tlb_remove_page':
        include/asm-generic/tlb.h:105: error: implicit declaration of function `page_cache_release'
      
      free_pages_and_swap_cache() and free_page_and_swap_cache() are macros
      which call release_pages() and page_cache_release().  The obvious fix is
      to include pagemap.h in swap.h, where those macros are defined.  But that
      breaks sparc for weird reasons.
      
      So fix it within mm/pgtable-generic.c instead.
      Reported-by: default avatarYoichi Yuasa <yuasa@linux-mips.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Sergei Shtylyov <sshtylyov@mvista.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f95ba941
    • Andrea Arcangeli's avatar
      thp: fix PARAVIRT x86 32bit noPAE · cacf061c
      Andrea Arcangeli authored
      This fixes TRANSPARENT_HUGEPAGE=y with PARAVIRT=y and HIGHMEM64=n.
      
      The #ifdef that this patch removes was erratically introduced to fix a
      build error for noPAE (where pmd.pmd doesn't exist).  So then the kernel
      built but it failed at runtime because set_pmd_at was a noop.  This will
      correct it by enabling set_pmd_at for noPAE mode too.
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Reported-by: default avatarwerner <w.landgraf@ru.ru>
      Reported-by: default avatarMinchan Kim <minchan.kim@gmail.com>
      Tested-by: default avatarMinchan Kim <minchan.kim@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cacf061c
  2. 25 Jan, 2011 29 commits
  3. 24 Jan, 2011 2 commits
    • Dave Airlie's avatar
      Merge branch 'drm-intel-fixes-2' of... · abb72c82
      Dave Airlie authored
      Merge branch 'drm-intel-fixes-2' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel into drm-fixes
      
      * 'drm-intel-fixes-2' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel: (30 commits)
        drm/i915: Prevent uninitialised reads during error state capture
        drm/i915: Use consistent mappings for OpRegion between ACPI and i915
        drm/i915: Handle the no-interrupts case for UMS by polling
        drm/i915: Disable high-precision vblank timestamping for UMS
        drm/i915: Increase the amount of defense before computing vblank timestamps
        drm/i915,agp/intel: Do not clear stolen entries
        Remove MAYBE_BUILD_BUG_ON
        BUILD_BUG_ON: make it handle more cases
        module: fix missing semicolons in MODULE macro usage
        param: add null statement to compiled-in module params
        module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n
        module: show version information for built-in modules in sysfs
        selinux: return -ENOMEM when memory allocation fails
        tpm: fix panic caused by "tpm: Autodetect itpm devices"
        TPM: Long default timeout fix
        trusted keys: Fix a memory leak in trusted_update().
        keys: add trusted and encrypted maintainers
        encrypted-keys: rename encrypted_defined files to encrypted
        trusted-keys: rename trusted_defined files to trusted
        drm/i915: Recognise non-VGA display devices
        ...
      abb72c82
    • Alex Deucher's avatar
      drm/radeon/kms: add new radeon_info ioctl query for clock crystal freq · 58bbf018
      Alex Deucher authored
      Needed for timer queries in the 3D driver.
      Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@gmail.com>
      58bbf018