Skip to content
  1. Oct 01, 2016
    • John Youn's avatar
      include/linux/property.h: fix typo/compile error · 37aa7271
      John Youn authored
      This fixes commit d76eebfa ("include/linux/property.h: fix build
      issues with gcc-4.4.4").
      
      With that commit we get the following compile error when using the
      PROPERTY_ENTRY_INTEGER_ARRAY macro.
      
       include/linux/property.h:201:39: error: `u32_data' undeclared (first
                       use in this function)
        PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u32, _val_)
                                             ^
       include/linux/property.h:193:17: note: in definition of macro
                       `PROPERTY_ENTRY_INTEGER_ARRAY'
        { .pointer = { _type_##_data = _val_ } },  \
                       ^
      
      This needs a '.' to reference the union member.  It seems this was just
      overlooked here since it is done correctly in similar constructs in
      other parts of the original commit.
      
      This fix is in preparation of upcoming commits that will use this macro.
      
      Fixes: commit d76eebfa
      
       ("include/linux/property.h: fix build issues with gcc-4.4.4")
      Link: http://lkml.kernel.org/r/2de3b929290d88a723ed829a3e3cbd02044714df.1475114627.git.johnyoun@synopsys.com
      Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      37aa7271
    • Eric Ren's avatar
      ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock() · c33f0785
      Eric Ren authored
      
      
      The testcase "mmaptruncate" of ocfs2-test deadlocks occasionally.
      
      In this testcase, we create a 2*CLUSTER_SIZE file and mmap() on it;
      there are 2 process repeatedly performing the following operations
      respectively: one is doing memset(mmaped_addr + 2*CLUSTER_SIZE - 1, 'a',
      1), while the another is playing ftruncate(fd, 2*CLUSTER_SIZE) and then
      ftruncate(fd, CLUSTER_SIZE) again and again.
      
      This is the backtrace when the deadlock happens:
      
         __wait_on_bit_lock+0x50/0xa0
         __lock_page+0xb7/0xc0
         ocfs2_write_begin_nolock+0x163f/0x1790 [ocfs2]
         ocfs2_page_mkwrite+0x1c7/0x2a0 [ocfs2]
         do_page_mkwrite+0x66/0xc0
         handle_mm_fault+0x685/0x1350
         __do_page_fault+0x1d8/0x4d0
         trace_do_page_fault+0x37/0xf0
         do_async_page_fault+0x19/0x70
         async_page_fault+0x28/0x30
      
      In ocfs2_write_begin_nolock(), we first grab the pages and then allocate
      disk space for this write; ocfs2_try_to_free_truncate_log() will be
      called if -ENOSPC is returned; if we're lucky to get enough clusters,
      which is usually the case, we start over again.
      
      But in ocfs2_free_write_ctxt() the target page isn't unlocked, so we
      will deadlock when trying to grab the target page again.
      
      Also, -ENOMEM might be returned in ocfs2_grab_pages_for_write().
      Another deadlock will happen in __do_page_mkwrite() if
      ocfs2_page_mkwrite() returns non-VM_FAULT_LOCKED, and along with a
      locked target page.
      
      These two errors fail on the same path, so fix them by unlocking the
      target page manually before ocfs2_free_write_ctxt().
      
      Jan Kara helps me clear out the JBD2 part, and suggest the hint for root
      cause.
      
      Changes since v1:
      1. Also put ENOMEM error case into consideration.
      
      Link: http://lkml.kernel.org/r/1474173902-32075-1-git-send-email-zren@suse.com
      Signed-off-by: default avatarEric Ren <zren@suse.com>
      Reviewed-by: default avatarHe Gang <ghe@suse.com>
      Acked-by: default avatarJoseph Qi <joseph.qi@huawei.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c33f0785
    • Johannes Weiner's avatar
      mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page() · 22f2ac51
      Johannes Weiner authored
      Antonio reports the following crash when using fuse under memory pressure:
      
        kernel BUG at /build/linux-a2WvEb/linux-4.4.0/mm/workingset.c:346!
        invalid opcode: 0000 [#1] SMP
        Modules linked in: all of them
        CPU: 2 PID: 63 Comm: kswapd0 Not tainted 4.4.0-36-generic #55-Ubuntu
        Hardware name: System manufacturer System Product Name/P8H67-M PRO, BIOS 3904 04/27/2013
        task: ffff88040cae6040 ti: ffff880407488000 task.ti: ffff880407488000
        RIP: shadow_lru_isolate+0x181/0x190
        Call Trace:
          __list_lru_walk_one.isra.3+0x8f/0x130
          list_lru_walk_one+0x23/0x30
          scan_shadow_nodes+0x34/0x50
          shrink_slab.part.40+0x1ed/0x3d0
          shrink_zone+0x2ca/0x2e0
          kswapd+0x51e/0x990
          kthread+0xd8/0xf0
          ret_from_fork+0x3f/0x70
      
      which corresponds to the following sanity check in the shadow node
      tracking:
      
        BUG_ON(node->count & RADIX_TREE_COUNT_MASK);
      
      The workingset code tracks radix tree nodes that exclusively contain
      shadow entries of evicted pages in them, and this (somewhat obscure)
      line checks whether there are real pages left that would interfere with
      reclaim of the radix tree node under memory pressure.
      
      While discussing ways how fuse might sneak pages into the radix tree
      past the workingset code, Miklos pointed to replace_page_cache_page(),
      and indeed there is a problem there: it properly accounts for the old
      page being removed - __delete_from_page_cache() does that - but then
      does a raw raw radix_tree_insert(), not accounting for the replacement
      page.  Eventually the page count bits in node->count underflow while
      leaving the node incorrectly linked to the shadow node LRU.
      
      To address this, make sure replace_page_cache_page() uses the tracked
      page insertion code, page_cache_tree_insert().  This fixes the page
      accounting and makes sure page-containing nodes are properly unlinked
      from the shadow node LRU again.
      
      Also, make the sanity checks a bit less obscure by using the helpers for
      checking the number of pages and shadows in a radix tree node.
      
      Fixes: 449dd698
      
       ("mm: keep page cache radix tree nodes in check")
      Link: http://lkml.kernel.org/r/20160919155822.29498-1-hannes@cmpxchg.org
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Reported-by: default avatarAntonio SJ Musumeci <trapexit@spawn.link>
      Debugged-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
      Cc: <stable@vger.kernel.org>	[3.15+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      22f2ac51
  2. Sep 30, 2016
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.8-final' of git://people.freedesktop.org/~airlied/linux · e3b3656c
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "drm fixes for final 4.8.
      
        One big regression fix for udl, along with two amdgpu fixes and two
        nouveau fixes.
      
        All seems pretty safe and useful"
      
      * tag 'drm-fixes-for-v4.8-final' of git://people.freedesktop.org/~airlied/linux:
        drm/udl: fix line iterator in damage handling
        drm/radeon/si/dpm: add workaround for for Jet parts
        drm/amdgpu: disable CRTCs before teardown
        drm/nouveau: Revert "bus: remove cpu_coherent flag"
        drm/nouveau/fifo/nv04: avoid ramht race against cookie insertion
      e3b3656c
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · c6169de7
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
      
       - Four fixes for "flush hint" support.
      
         Flush hints are addresses advertised by the ACPI 6+ NFIT (NVDIMM
         Firmware Interface Table) that when written and fenced guarantee that
         writes pending in platform write buffers (outside the cpu) have been
         flushed to media.  They might also be used by hypervisors as a
         trigger condition to flush guest-persistent memory ranges to storage.
      
          Fix a potential data corruption issue, a broken definition of the
          hint array, a wrong allocation size for the unit test implementation
          of the flush hint table, and missing NULL check in an error path.
      
          The unit test, while it did not prevent these bugs from being
          merged, at least triggered occasional crashes in advance of
          production usages.
      
       - Fix handling of ACPI DSM error status results.  The DSM mechanism
         allows communication with platform and memory device firmware.  We
         correctly parse known errors, but were silently ignoring others.
      
         Fix it to consistently fail any command with a non-zero status return
         that we otherwise do not interpret / handle.
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm, region: fix flush hint table thinko
        nfit: fail DSMs that return non-zero status by default
        libnvdimm: fix devm_nvdimm_memremap() error path
        tools/testing/nvdimm: fix allocation range for mock flush hint tables
        nvdimm: fix PHYS_PFN/PFN_PHYS mixup
      c6169de7
  3. Sep 29, 2016
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 53061afe
      Linus Torvalds authored
      Merge fixes from Andrew Morton:
       "4 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mem-hotplug: use nodes that contain memory as mask in new_node_page()
        scripts/recordmcount.c: account for .softirqentry.text
        dma-mapping.h: preserve unmap info for CONFIG_DMA_API_DEBUG
        mm,ksm: fix endless looping in allocating memory when ksm enable
      53061afe
    • Li Zhong's avatar
      mem-hotplug: use nodes that contain memory as mask in new_node_page() · 231e97e2
      Li Zhong authored
      9bb627be ("mem-hotplug: don't clear the only node in new_node_page()")
      prevents allocating from an empty nodemask, but as David points out, it is
      still wrong.  As node_online_map may include memoryless nodes, only
      allocating from these nodes is meaningless.
      
      This patch uses node_states[N_MEMORY] mask to prevent the above case.
      
      Fixes: 9bb627be ("mem-hotplug: don't clear the only node in new_node_page()")
      Fixes: 394e31d2
      
       ("mem-hotplug: alloc new page from a nearest neighbor node when mem-offline")
      Link: http://lkml.kernel.org/r/1474447117.28370.6.camel@TP420
      Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
      Suggested-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: John Allen <jallen@linux.vnet.ibm.com>
      Cc: Xishi Qiu <qiuxishi@huawei.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      231e97e2
    • Dmitry Vyukov's avatar
      scripts/recordmcount.c: account for .softirqentry.text · e436fd61
      Dmitry Vyukov authored
      be7635e7 ("arch, ftrace: for KASAN put hard/soft IRQ entries into
      separate sections") added .softirqentry.text section, but it was not added
      to recordmcount.  So functions in the section are untracable.  Add the
      section to scripts/recordmcount.c and scripts/recordmcount.pl.
      
      Fixes: be7635e7
      
       ("arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections")
      Link: http://lkml.kernel.org/r/1474902626-73468-1-git-send-email-dvyukov@google.com
      Signed-off-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Acked-by: default avatarSteve Rostedt <rostedt@goodmis.org>
      Cc: <stable@vger.kernel.org>	[4.6+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e436fd61
    • Andrey Smirnov's avatar
      dma-mapping.h: preserve unmap info for CONFIG_DMA_API_DEBUG · 2481366a
      Andrey Smirnov authored
      
      
      When CONFIG_DMA_API_DEBUG is enabled we need to preserve unmapping address
      even if "unmap" is a no-op for our architecutre because we need
      debug_dma_unmap_page() to correctly cleanup all of the debug bookkeeping.
      Failing to do so results in a false positive warnings about previously
      mapped areas never being unmapped.
      
      Link: http://lkml.kernel.org/r/1474387125-3713-1-git-send-email-andrew.smirnov@gmail.com
      Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Cc: "Luis R. Rodriguez" <mcgrof@suse.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Geliang Tang <geliangtang@163.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2481366a
    • zhong jiang's avatar
      mm,ksm: fix endless looping in allocating memory when ksm enable · 5b398e41
      zhong jiang authored
      
      
      I hit the following hung task when runing a OOM LTP test case with 4.1
      kernel.
      
      Call trace:
      [<ffffffc000086a88>] __switch_to+0x74/0x8c
      [<ffffffc000a1bae0>] __schedule+0x23c/0x7bc
      [<ffffffc000a1c09c>] schedule+0x3c/0x94
      [<ffffffc000a1eb84>] rwsem_down_write_failed+0x214/0x350
      [<ffffffc000a1e32c>] down_write+0x64/0x80
      [<ffffffc00021f794>] __ksm_exit+0x90/0x19c
      [<ffffffc0000be650>] mmput+0x118/0x11c
      [<ffffffc0000c3ec4>] do_exit+0x2dc/0xa74
      [<ffffffc0000c46f8>] do_group_exit+0x4c/0xe4
      [<ffffffc0000d0f34>] get_signal+0x444/0x5e0
      [<ffffffc000089fcc>] do_signal+0x1d8/0x450
      [<ffffffc00008a35c>] do_notify_resume+0x70/0x78
      
      The oom victim cannot terminate because it needs to take mmap_sem for
      write while the lock is held by ksmd for read which loops in the page
      allocator
      
      ksm_do_scan
      	scan_get_next_rmap_item
      		down_read
      		get_next_rmap_item
      			alloc_rmap_item   #ksmd will loop permanently.
      
      There is no way forward because the oom victim cannot release any memory
      in 4.1 based kernel.  Since 4.6 we have the oom reaper which would solve
      this problem because it would release the memory asynchronously.
      Nevertheless we can relax alloc_rmap_item requirements and use
      __GFP_NORETRY because the allocation failure is acceptable as ksm_do_scan
      would just retry later after the lock got dropped.
      
      Such a patch would be also easy to backport to older stable kernels which
      do not have oom_reaper.
      
      While we are at it add GFP_NOWARN so the admin doesn't have to be alarmed
      by the allocation failure.
      
      Link: http://lkml.kernel.org/r/1474165570-44398-1-git-send-email-zhongjiang@huawei.com
      Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
      Suggested-by: default avatarHugh Dickins <hughd@google.com>
      Suggested-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarHugh Dickins <hughd@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>
      5b398e41
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20160928' of git://git.infradead.org/linux-mtd · ae6dd8d6
      Linus Torvalds authored
      Pull late MTD fixes from Brian Norris:
       "Another round of MTD fixes for v4.8
      
        My apologies for sending this so late.  I've been fairly absent as a
        maintainer this cycle, but I did queue these up weeks ago.  In the
        meantime, Richard was able to handle some other fixes (thanks!) but
        didn't pick these up.
      
        On the bright side, these are very simple changes that should carry
        little risk.
      
        Summary:
      
         - Davinci NAND: fix a long-standing bug in how we clear/prep 4-bit ECC
      
         - OMAP NAND: an error-handling fix that made it into v4.8-rc1 caused
           error-handling cases in other configurations/code-paths; this fixes
           the fix"
      
      * tag 'for-linus-20160928' of git://git.infradead.org/linux-mtd:
        mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl
        mtd: nand: omap2: Don't call dma_release_channel() if dma_request_chan() failed
      ae6dd8d6
    • Mark Fasheh's avatar
      MAINTAINERS: Update my e-mail · 0a966fa8
      Mark Fasheh authored
      
      
      I will be starting employment at Versity next week and would like to update
      my MAINTAINERS e-mail to reflect that change. My versity e-mail is already
      activated so I shouldn't get any bounces on the new one. My ability to help
      with Ocfs2 kernel maintenance won't change as a result of the new job.
      
      Signed-off-by: default avatarMark Fasheh <mfasheh@versity.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0a966fa8
  4. Sep 28, 2016
  5. Sep 26, 2016
    • Linus Torvalds's avatar
      Linux 4.8-rc8 · 08895a8b
      Linus Torvalds authored
      08895a8b
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 4c04b4b5
      Linus Torvalds authored
      Pull tracefs fixes from Steven Rostedt:
       "Al Viro has been looking at the tracefs code, and has pointed out some
        issues.  This contains one fix by me and one by Al.  I'm sure that
        he'll come up with more but for now I tested these patches and they
        don't appear to have any negative impact on tracing"
      
      * tag 'trace-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        fix memory leaks in tracing_buffers_splice_read()
        tracing: Move mutex to protect against resetting of seq data
      4c04b4b5
    • Dave Chinner's avatar
      fault_in_multipages_readable() throws set-but-unused error · 90b75db6
      Dave Chinner authored
      When building XFS with -Werror, it now fails with:
      
        include/linux/pagemap.h: In function 'fault_in_multipages_readable':
        include/linux/pagemap.h:602:16: error: variable 'c' set but not used [-Werror=unused-but-set-variable]
          volatile char c;
                        ^
      
      This is a regression caused by commit e23d4159
      
       ("fix
      fault_in_multipages_...() on architectures with no-op access_ok()").
      Fix it by re-adding the "(void)c" trick taht was previously used to make
      the compiler think the variable is used.
      
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      90b75db6
    • Lorenzo Stoakes's avatar
      mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing · 38e08854
      Lorenzo Stoakes authored
      The NUMA balancing logic uses an arch-specific PROT_NONE page table flag
      defined by pte_protnone() or pmd_protnone() to mark PTEs or huge page
      PMDs respectively as requiring balancing upon a subsequent page fault.
      User-defined PROT_NONE memory regions which also have this flag set will
      not normally invoke the NUMA balancing code as do_page_fault() will send
      a segfault to the process before handle_mm_fault() is even called.
      
      However if access_remote_vm() is invoked to access a PROT_NONE region of
      memory, handle_mm_fault() is called via faultin_page() and
      __get_user_pages() without any access checks being performed, meaning
      the NUMA balancing logic is incorrectly invoked on a non-NUMA memory
      region.
      
      A simple means of triggering this problem is to access PROT_NONE mmap'd
      memory using /proc/self/mem which reliably results in the NUMA handling
      functions being invoked when CONFIG_NUMA_BALANCING is set.
      
      This issue was reported in bugzilla (issue 99101) which includes some
      simple repro code.
      
      There are BUG_ON() checks in do_numa_page() and do_huge_pmd_numa_page()
      added at commit c0e7cad9
      
       to avoid accidentally provoking strange
      behaviour by attempting to apply NUMA balancing to pages that are in
      fact PROT_NONE.  The BUG_ON()'s are consistently triggered by the repro.
      
      This patch moves the PROT_NONE check into mm/memory.c rather than
      invoking BUG_ON() as faulting in these pages via faultin_page() is a
      valid reason for reaching the NUMA check with the PROT_NONE page table
      flag set and is therefore not always a bug.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=99101
      Reported-by: default avatarTrevor Saunders <tbsaunde@tbsaunde.org>
      Signed-off-by: default avatarLorenzo Stoakes <lstoakes@gmail.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38e08854
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 831e45d8
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "A round of 4.8 fixes:
      
        MIPS generic code:
         - Add a missing ".set pop" in an early commit
         - Fix memory regions reaching top of physical
         - MAAR: Fix address alignment
         - vDSO: Fix Malta EVA mapping to vDSO page structs
         - uprobes: fix incorrect uprobe brk handling
         - uprobes: select HAVE_REGS_AND_STACK_ACCESS_API
         - Avoid a BUG warning during PR_SET_FP_MODE prctl
         - SMP: Fix possibility of deadlock when bringing CPUs online
         - R6: Remove compact branch policy Kconfig entries
         - Fix size calc when avoiding IPIs for small icache flushes
         - Fix pre-r6 emulation FPU initialisation
         - Fix delay slot emulation count in debugfs
      
        ATH79:
         - Fix test for error return of clk_register_fixed_factor.
      
        Octeon:
         - Fix kernel header to work for VDSO build.
         - Fix initialization of platform device probing.
      
        paravirt:
         - Fix undefined reference to smp_bootstrap"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: Fix delay slot emulation count in debugfs
        MIPS: SMP: Fix possibility of deadlock when bringing CPUs online
        MIPS: Fix pre-r6 emulation FPU initialisation
        MIPS: vDSO: Fix Malta EVA mapping to vDSO page structs
        MIPS: Select HAVE_REGS_AND_STACK_ACCESS_API
        MIPS: Octeon: Fix platform bus probing
        MIPS: Octeon: mangle-port: fix build failure with VDSO code
        MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...)
        MIPS: c-r4k: Fix size calc when avoiding IPIs for small icache flushes
        MIPS: Add a missing ".set pop" in an early commit
        MIPS: paravirt: Fix undefined reference to smp_bootstrap
        MIPS: Remove compact branch policy Kconfig entries
        MIPS: MAAR: Fix address alignment
        MIPS: Fix memory regions reaching top of physical
        MIPS: uprobes: fix incorrect uprobe brk handling
        MIPS: ath79: Fix test for error return of clk_register_fixed_factor().
      831e45d8
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 751b9a5d
      Linus Torvalds authored
      Pull one more powerpc fix from Michael Ellerman:
       "powernv/pci: Fix m64 checks for SR-IOV and window alignment from
        Russell Currey"
      
      * tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment
      751b9a5d
    • Linus Torvalds's avatar
      radix tree: fix sibling entry handling in radix_tree_descend() · 8d2c0d36
      Linus Torvalds authored
      
      
      The fixes to the radix tree test suite show that the multi-order case is
      broken.  The basic reason is that the radix tree code uses tagged
      pointers with the "internal" bit in the low bits, and calculating the
      pointer indices was supposed to mask off those bits.  But gcc will
      notice that we then use the index to re-create the pointer, and will
      avoid doing the arithmetic and use the tagged pointer directly.
      
      This cleans the code up, using the existing is_sibling_entry() helper to
      validate the sibling pointer range (instead of open-coding it), and
      using entry_to_node() to mask off the low tag bit from the pointer.  And
      once you do that, you might as well just use the now cleaned-up pointer
      directly.
      
      [ Side note: the multi-order code isn't actually ever used in the kernel
        right now, and the only reason I didn't just delete all that code is
        that Kirill Shutemov piped up and said:
      
          "Well, my ext4-with-huge-pages patchset[1] uses multi-order entries.
           It also converts shmem-with-huge-pages and hugetlb to them.
      
           I'm okay with converting it to other mechanism, but I need
           something.  (I looked into Konstantin's RFC patchset[2].  It looks
           okay, but I don't feel myself qualified to review it as I don't
           know much about radix-tree internals.)"
      
        [1] http://lkml.kernel.org/r/20160915115523.29737-1-kirill.shutemov@linux.intel.com
        [2] http://lkml.kernel.org/r/147230727479.9957.1087787722571077339.stgit@zurg ]
      
      Reported-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Cedric Blancher <cedric.blancher@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8d2c0d36
    • Matthew Wilcox's avatar
      radix tree test suite: Test radix_tree_replace_slot() for multiorder entries · 62fd5258
      Matthew Wilcox authored
      
      
      When we replace a multiorder entry, check that all indices reflect the
      new value.
      
      Also, compile the test suite with -O2, which shows other problems with
      the code due to some dodgy pointer operations in the radix tree code.
      
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      62fd5258
    • Al Viro's avatar
      fix memory leaks in tracing_buffers_splice_read() · 1ae2293d
      Al Viro authored
      
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1ae2293d
  6. Sep 25, 2016
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Move mutex to protect against resetting of seq data · 1245800c
      Steven Rostedt (Red Hat) authored
      The iter->seq can be reset outside the protection of the mutex. So can
      reading of user data. Move the mutex up to the beginning of the function.
      
      Fixes: d7350c3f
      
       ("tracing/core: make the read callbacks reentrants")
      Cc: stable@vger.kernel.org # 2.6.30+
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      1245800c
    • Paul Burton's avatar
      MIPS: Fix delay slot emulation count in debugfs · 116e7111
      Paul Burton authored
      Commit 432c6bac
      
       ("MIPS: Use per-mm page to execute branch delay slot
      instructions") accidentally removed use of the MIPS_FPU_EMU_INC_STATS
      macro from do_dsemulret, leading to the ds_emul file in debugfs always
      returning zero even though we perform delay slot emulations.
      
      Fix this by re-adding the use of the MIPS_FPU_EMU_INC_STATS macro.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Fixes: 432c6bac
      
       ("MIPS: Use per-mm page to execute branch delay slot instructions")
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14301/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      116e7111
    • Matt Redfearn's avatar
      MIPS: SMP: Fix possibility of deadlock when bringing CPUs online · 8f46cca1
      Matt Redfearn authored
      
      
      This patch fixes the possibility of a deadlock when bringing up
      secondary CPUs.
      The deadlock occurs because the set_cpu_online() is called before
      synchronise_count_slave(). This can cause a deadlock if the boot CPU,
      having scheduled another thread, attempts to send an IPI to the
      secondary CPU, which it sees has been marked online. The secondary is
      blocked in synchronise_count_slave() waiting for the boot CPU to enter
      synchronise_count_master(), but the boot cpu is blocked in
      smp_call_function_many() waiting for the secondary to respond to it's
      IPI request.
      
      Fix this by marking the CPU online in cpu_callin_map and synchronising
      counters before declaring the CPU online and calculating the maps for
      IPIs.
      
      Signed-off-by: default avatarMatt Redfearn <matt.redfearn@imgtec.com>
      Reported-by: default avatarJustin Chen <justinpopo6@gmail.com>
      Tested-by: default avatarJustin Chen <justinpopo6@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: stable@vger.kernel.org # v4.1+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14302/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      8f46cca1
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9c0e28a7
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "Three fixlets for perf:
      
         - add a missing NULL pointer check in the intel BTS driver
      
         - make BTS an exclusive PMU because BTS can only handle one event at
           a time
      
         - ensure that exclusive events are limited to one PMU so that several
           exclusive events can be scheduled on different PMU instances"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Limit matching exclusive events to one PMU
        perf/x86/intel/bts: Make it an exclusive PMU
        perf/x86/intel/bts: Make sure debug store is valid
      9c0e28a7
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2507c856
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "Two smallish fixes:
      
         - use the proper asm constraint in the Super-H atomic_fetch_ops
      
         - a trivial typo fix in the Kconfig help text"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text
        locking/atomic, arch/sh: Fix ATOMIC_FETCH_OP()
      2507c856
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 709b8f67
      Linus Torvalds authored
      Pull EFI fixes from Thomas Gleixner:
       "Two fixes for EFI/PAT:
      
         - a 32bit overflow bug in the PAT code which was unearthed by the
           large EFI mappings
      
         - prevent a boot hang on large systems when EFI mixed mode is enabled
           but not used"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/efi: Only map RAM into EFI page tables if in mixed-mode
        x86/mm/pat: Prevent hang during boot when mapping pages
      709b8f67
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4b8b0ff6
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Three fixes for irq core and irq chip drivers:
      
         - Do not set the irq type if type is NONE.  Fixes a boot regression
           on various SoCs
      
         - Use the proper cpu for setting up the GIC target list.  Discovered
           by the cpumask debugging code.
      
         - A rather large fix for the MIPS-GIC so per cpu local interrupts
           work again.  This was discovered late because the code falls back
           to slower timers which use normal device interrupts"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/mips-gic: Fix local interrupts
        irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning
        genirq: Skip chained interrupt trigger setup if type is IRQ_TYPE_NONE
      4b8b0ff6
    • Dan Williams's avatar
      libnvdimm, region: fix flush hint table thinko · 595c7307
      Dan Williams authored
      
      
      The definition of the flush hint table as:
      
      	void __iomem *flush_wpq[0][0];
      
      ...passed the unit test, but is broken as flush_wpq[0][1] and
      flush_wpq[1][0] refer to the same entry.  Fix this to use a helper that
      calculates a slot in the table based on the geometry of flush hints in
      the region.  This is important to get right since virtualization
      solutions use this mechanism to trigger hypervisor flushes to platform
      persistence.
      
      Reported-by: default avatarDave Jiang <dave.jiang@intel.com>
      Tested-by: default avatarDave Jiang <dave.jiang@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      595c7307
    • Linus Torvalds's avatar
      Merge branch 'hughd-fixes' (patches from Hugh Dickins) · 0f265741
      Linus Torvalds authored
      Merge VM fixes from High Dickins:
       "I get the impression that Andrew is away or busy at the moment, so I'm
        going to send you three independent uncontroversial little mm fixes
        directly - though none is strictly a 4.8 regression fix.
      
         - shmem: fix tmpfs to handle the huge= option properly from Toshi
           Kani is a one-liner to fix a major embarrassment in 4.8's hugepages
           on tmpfs feature: although Hillf pointed it out in June, somehow
           both Kirill and I repeatedly dropped the ball on this one.  You
           might wonder if the feature got tested at all with that bug in:
           yes, it did, but for wider testing coverage, Kirill and I had each
           relied too much on an override which bypasses that condition.
      
         - huge tmpfs: fix Committed_AS leak just a run-of-the-mill accounting
           fix in the same feature.
      
         - mm: delete unnecessary and unsafe init_tlb_ubc() is an unrelated
           fix to 4.3's TLB flush batching in reclaim: the bug would be rare,
           and none of us will be shamed if this one misses 4.8; but it got
           such a quick ack from Mel today that I'm inclined to offer it along
           with the first two"
      
      * emailed patches from Hugh Dickins <hughd@google.com>:
        mm: delete unnecessary and unsafe init_tlb_ubc()
        huge tmpfs: fix Committed_AS leak
        shmem: fix tmpfs to handle the huge= option properly
      0f265741
    • Hugh Dickins's avatar
      mm: delete unnecessary and unsafe init_tlb_ubc() · b385d21f
      Hugh Dickins authored
      init_tlb_ubc() looked unnecessary to me: tlb_ubc is statically
      initialized with zeroes in the init_task, and copied from parent to
      child while it is quiescent in arch_dup_task_struct(); so I went to
      delete it.
      
      But inserted temporary debug WARN_ONs in place of init_tlb_ubc() to
      check that it was always empty at that point, and found them firing:
      because memcg reclaim can recurse into global reclaim (when allocating
      biosets for swapout in my case), and arrive back at the init_tlb_ubc()
      in shrink_node_memcg().
      
      Resetting tlb_ubc.flush_required at that point is wrong: if the upper
      level needs a deferred TLB flush, but the lower level turns out not to,
      we miss a TLB flush.  But fortunately, that's the only part of the
      protocol that does not nest: with the initialization removed, cpumask
      collects bits from upper and lower levels, and flushes TLB when needed.
      
      Fixes: 72b252ae
      
       ("mm: send one IPI per CPU to TLB flush all entries after unmapping pages")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: stable@vger.kernel.org # 4.3+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b385d21f
    • Hugh Dickins's avatar
      huge tmpfs: fix Committed_AS leak · 71664665
      Hugh Dickins authored
      Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
      bigger and bigger: just a cosmetic issue for most users, but disabling
      for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).
      
      shmem_uncharge() was forgetting to unaccount __vm_enough_memory's
      charge, and shmem_charge() was forgetting it on the filesystem-full
      error path.
      
      Fixes: 800d8c63
      
       ("shmem: add huge pages support")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      71664665
    • Toshi Kani's avatar
      shmem: fix tmpfs to handle the huge= option properly · 3089bf61
      Toshi Kani authored
      
      
      shmem_get_unmapped_area() checks SHMEM_SB(sb)->huge incorrectly, which
      leads to a reversed effect of "huge=" mount option.
      
      Fix the check in shmem_get_unmapped_area().
      
      Note, the default value of SHMEM_SB(sb)->huge remains as
      SHMEM_HUGE_NEVER.  User will need to specify "huge=" option to enable
      huge page mappings.
      
      Reported-by: default avatarHillf Danton <hillf.zj@alibaba-inc.com>
      Signed-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3089bf61
  7. Sep 24, 2016
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · bd5dbcb4
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Three driver bugfixes: fixing uninitialized memory pointers (eg20t),
        pm/clock imbalance (qup), and a wrongly set cached variable (pc954x)"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended
        i2c: mux: pca954x: retry updating the mux selection on failure
        i2c-eg20t: fix race between i2c init and interrupt enable
      bd5dbcb4