Skip to content
  1. Oct 20, 2013
  2. Oct 19, 2013
  3. Oct 18, 2013
  4. Oct 17, 2013
    • Rafael J. Wysocki's avatar
      ACPI / PM: Drop two functions that are not used any more · 2421ad48
      Rafael J. Wysocki authored
      
      
      Two functions defined in device_pm.c, acpi_dev_pm_add_dependent()
      and acpi_dev_pm_remove_dependent(), have no callers and may be
      dropped, so drop them.
      
      Moreover, they are the only functions adding entries to and removing
      entries from the power_dependent list in struct acpi_device, so drop
      that list too.
      
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2421ad48
    • Aaron Lu's avatar
      ATA / ACPI: remove power dependent device handling · b08fc109
      Aaron Lu authored
      Previously, we wanted SCSI devices corrsponding to ATA devices to
      be runtime resumed when the power resource for those ATA device was
      turned on by some other device, so we added the SCSI device to the
      dependent device list of the ATA device's ACPI node.  However, this
      code has no effect after commit 41863fce
      
       (ACPI / power: Drop automaitc
      resume of power resource dependent devices) and the mechanism it was
      supposed to implement is regarded as a bad idea now, so drop it.
      
      [rjw: Changelog]
      Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b08fc109
    • Linus Torvalds's avatar
      Merge branch 'akpm' (fixes from Andrew Morton) · 056cdce0
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
        mm: revert mremap pud_free anti-fix
        mm: fix BUG in __split_huge_page_pmd
        swap: fix set_blocksize race during swapon/swapoff
        procfs: call default get_unmapped_area on MMU-present architectures
        procfs: fix unintended truncation of returned mapped address
        writeback: fix negative bdi max pause
        percpu_refcount: export symbols
        fs: buffer: move allocation failure loop into the allocator
        mm: memcg: handle non-error OOM situations more gracefully
        tools/testing/selftests: fix uninitialized variable
        block/partitions/efi.c: treat size mismatch as a warning, not an error
        mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
        mm/zswap: bugfix: memory leak when re-swapon
        mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
        mm: migration: do not lose soft dirty bit if page is in migration state
        gcov: MAINTAINERS: Add an entry for gcov
        mm/hugetlb.c: correct missing private flag clearing
        mm/vmscan.c: don't forget to free shrinker->nr_deferred
        ipc/sem.c: synchronize semop and semctl with IPC_RMID
        ipc: update locking scheme comments
        ...
      056cdce0
    • Hugh Dickins's avatar
      mm: revert mremap pud_free anti-fix · 57a8f0cd
      Hugh Dickins authored
      Revert commit 1ecfd533 ("mm/mremap.c: call pud_free() after fail
      calling pmd_alloc()").
      
      The original code was correct: pud_alloc(), pmd_alloc(), pte_alloc_map()
      ensure that the pud, pmd, pt is already allocated, and seldom do they
      need to allocate; on failure, upper levels are freed if appropriate by
      the subsequent do_munmap().  Whereas commit 1ecfd533
      
       did an
      unconditional pud_free() of a most-likely still-in-use pud: saved only
      by the near-impossiblity of pmd_alloc() failing.
      
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Chen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      57a8f0cd
    • Hugh Dickins's avatar
      mm: fix BUG in __split_huge_page_pmd · 750e8165
      Hugh Dickins authored
      
      
      Occasionally we hit the BUG_ON(pmd_trans_huge(*pmd)) at the end of
      __split_huge_page_pmd(): seen when doing madvise(,,MADV_DONTNEED).
      
      It's invalid: we don't always have down_write of mmap_sem there: a racing
      do_huge_pmd_wp_page() might have copied-on-write to another huge page
      before our split_huge_page() got the anon_vma lock.
      
      Forget the BUG_ON, just go back and try again if this happens.
      
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      750e8165
    • Krzysztof Kozlowski's avatar
      swap: fix set_blocksize race during swapon/swapoff · 5b808a23
      Krzysztof Kozlowski authored
      
      
      Fix race between swapoff and swapon.  Swapoff used old_block_size from
      swap_info outside of swapon_mutex so it could be overwritten by
      concurrent swapon.
      
      The race has visible effect only if more than one swap block device
      exists with different block sizes (e.g.  /dev/sda1 with block size 4096
      and /dev/sdb1 with 512).  In such case it leads to setting the blocksize
      of swapped off device with wrong blocksize.
      
      The bug can be triggered with multiple concurrent swapoff and swapon:
      0. Swap for some device is on.
      1. swapoff:
      First the swapoff is called on this device and "struct swap_info_struct
      *p" is assigned. This is done under swap_lock however this lock is
      released for the call try_to_unuse().
      
      2. swapon:
      After the assignment above (and before acquiring swapon_mutex &
      swap_lock by swapoff) the swapon is called on the same device.
      The p->old_block_size is assigned to the value of block_size the device.
      This block size should be the same as previous but sometimes it is not.
      The swapon ends successfully.
      
      3. swapoff:
      Swapoff resumes, grabs the locks and mutex and continues to disable this
      swap device. Now it sets the block size to value taken from swap_info
      which was overwritten by swapon in 2.
      
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Reported-by: default avatarWeijie Yang <weijie.yang.kh@gmail.com>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Shaohua Li <shli@fusionio.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5b808a23
    • HATAYAMA Daisuke's avatar
      procfs: call default get_unmapped_area on MMU-present architectures · fad1a86e
      HATAYAMA Daisuke authored
      Commit c4fe2448
      
       ("sparc: fix PCI device proc file mmap(2)") added
      proc_reg_get_unmapped_area in proc_reg_file_ops and
      proc_reg_file_ops_no_compat, by which now mmap always returns EIO if
      get_unmapped_area method is not defined for the target procfs file,
      which causes regression of mmap on /proc/vmcore.
      
      To address this issue, like get_unmapped_area(), call default
      current->mm->get_unmapped_area on MMU-present architectures if
      pde->proc_fops->get_unmapped_area, i.e.  the one in actual file
      operation in the procfs file, is not defined.
      
      Reported-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Tested-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fad1a86e
    • HATAYAMA Daisuke's avatar
      procfs: fix unintended truncation of returned mapped address · 2cbe3b0a
      HATAYAMA Daisuke authored
      Currently, proc_reg_get_unmapped_area truncates upper 32-bit of the
      mapped virtual address returned from get_unmapped_area method in
      pde->proc_fops due to the variable rv of signed integer on x86_64.  This
      is too small to have vitual address of unsigned long on x86_64 since on
      x86_64, signed integer is of 4 bytes while unsigned long is of 8 bytes.
      To fix this issue, use unsigned long instead.
      
      Fixes a regression added in commit c4fe2448
      
       ("sparc: fix PCI device
      proc file mmap(2)").
      
      Signed-off-by: default avatarHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Tested-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2cbe3b0a
    • Fengguang Wu's avatar
      writeback: fix negative bdi max pause · e3b6c655
      Fengguang Wu authored
      
      
      Toralf runs trinity on UML/i386.  After some time it hangs and the last
      message line is
      
      	BUG: soft lockup - CPU#0 stuck for 22s! [trinity-child0:1521]
      
      It's found that pages_dirtied becomes very large.  More than 1000000000
      pages in this case:
      
      	period = HZ * pages_dirtied / task_ratelimit;
      	BUG_ON(pages_dirtied > 2000000000);
      	BUG_ON(pages_dirtied > 1000000000);      <---------
      
      UML debug printf shows that we got negative pause here:
      
      	ick: pause : -984
      	ick: pages_dirtied : 0
      	ick: task_ratelimit: 0
      
      	 pause:
      	+       if (pause < 0)  {
      	+               extern int printf(char *, ...);
      	+               printf("ick : pause : %li\n", pause);
      	+               printf("ick: pages_dirtied : %lu\n", pages_dirtied);
      	+               printf("ick: task_ratelimit: %lu\n", task_ratelimit);
      	+               BUG_ON(1);
      	+       }
      	        trace_balance_dirty_pages(bdi,
      
      Since pause is bounded by [min_pause, max_pause] where min_pause is also
      bounded by max_pause.  It's suspected and demonstrated that the
      max_pause calculation goes wrong:
      
      	ick: pause : -717
      	ick: min_pause : -177
      	ick: max_pause : -717
      	ick: pages_dirtied : 14
      	ick: task_ratelimit: 0
      
      The problem lies in the two "long = unsigned long" assignments in
      bdi_max_pause() which might go negative if the highest bit is 1, and the
      min_t(long, ...) check failed to protect it falling under 0.  Fix all of
      them by using "unsigned long" throughout the function.
      
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Reported-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Tested-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e3b6c655
    • Matias Bjorling's avatar
      percpu_refcount: export symbols · 5e9dd373
      Matias Bjorling authored
      
      
      Export the interface to be used within modules.
      
      Signed-off-by: default avatarMatias Bjorling <m@bjorling.me>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5e9dd373
    • Johannes Weiner's avatar
      fs: buffer: move allocation failure loop into the allocator · 84235de3
      Johannes Weiner authored
      
      
      Buffer allocation has a very crude indefinite loop around waking the
      flusher threads and performing global NOFS direct reclaim because it can
      not handle allocation failures.
      
      The most immediate problem with this is that the allocation may fail due
      to a memory cgroup limit, where flushers + direct reclaim might not make
      any progress towards resolving the situation at all.  Because unlike the
      global case, a memory cgroup may not have any cache at all, only
      anonymous pages but no swap.  This situation will lead to a reclaim
      livelock with insane IO from waking the flushers and thrashing unrelated
      filesystem cache in a tight loop.
      
      Use __GFP_NOFAIL allocations for buffers for now.  This makes sure that
      any looping happens in the page allocator, which knows how to
      orchestrate kswapd, direct reclaim, and the flushers sensibly.  It also
      allows memory cgroups to detect allocations that can't handle failure
      and will allow them to ultimately bypass the limit if reclaim can not
      make progress.
      
      Reported-by: default avatarazurIt <azurit@pobox.sk>
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      84235de3
    • Johannes Weiner's avatar
      mm: memcg: handle non-error OOM situations more gracefully · 49426420
      Johannes Weiner authored
      Commit 3812c8c8
      
       ("mm: memcg: do not trap chargers with full
      callstack on OOM") assumed that only a few places that can trigger a
      memcg OOM situation do not return VM_FAULT_OOM, like optional page cache
      readahead.  But there are many more and it's impractical to annotate
      them all.
      
      First of all, we don't want to invoke the OOM killer when the failed
      allocation is gracefully handled, so defer the actual kill to the end of
      the fault handling as well.  This simplifies the code quite a bit for
      added bonus.
      
      Second, since a failed allocation might not be the abrupt end of the
      fault, the memcg OOM handler needs to be re-entrant until the fault
      finishes for subsequent allocation attempts.  If an allocation is
      attempted after the task already OOMed, allow it to bypass the limit so
      that it can quickly finish the fault and invoke the OOM killer.
      
      Reported-by: default avatarazurIt <azurit@pobox.sk>
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      49426420