1. 19 Apr, 2017 3 commits
  2. 18 Apr, 2017 1 commit
    • Josh Poimboeuf's avatar
      x86/unwind: Ensure stack pointer is aligned · e335bb51
      Josh Poimboeuf authored
      With frame pointers disabled, on some older versions of GCC (like
      4.8.3), it's possible for the stack pointer to get aligned at a
      half-word boundary:
      
        00000000000004d0 <fib_table_lookup>:
             4d0:       41 57                   push   %r15
             4d2:       41 56                   push   %r14
             4d4:       41 55                   push   %r13
             4d6:       41 54                   push   %r12
             4d8:       55                      push   %rbp
             4d9:       53                      push   %rbx
             4da:       48 83 ec 24             sub    $0x24,%rsp
      
      In such a case, the unwinder ends up reading the entire stack at the
      wrong alignment.  Then the last read goes past the end of the stack,
      hitting the stack guard page:
      
        BUG: stack guard page was hit at ffffc900217c4000 (stack is ffffc900217c0000..ffffc900217c3fff)
        kernel stack overflow (page fault): 0000 [#1] SMP
        ...
      
      Fix it by ensuring the stack pointer is properly aligned before
      unwinding.
      Reported-by: default avatarJirka Hladky <jhladky@redhat.com>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: 7c7900f8 ("x86/unwind: Add new unwind interface and implementations")
      Link: http://lkml.kernel.org/r/cff33847cc9b02fa548625aa23268ac574460d8d.1492436590.git.jpoimboe@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e335bb51
  3. 14 Apr, 2017 4 commits
  4. 03 Apr, 2017 1 commit
    • Peter Zijlstra's avatar
      debug: Fix __bug_table[] in arch linker scripts · b5effd38
      Peter Zijlstra authored
      The kbuild test robot reported this build failure on a number
      of architectures:
      
       >         make.cross ARCH=arm
       >    lib/lib.a(bug.o): In function `find_bug':
       > >> lib/bug.c:135: undefined reference to `__start___bug_table'
       > >> lib/bug.c:135: undefined reference to `__stop___bug_table'
      
      Caused by:
      
        19d43626 ("debug: Add _ONCE() logic to report_bug()")
      
      Which moved the BUG_TABLE from RO_DATA_SECTION() to RW_DATA_SECTION(),
      but a number of architectures don't use RW_DATA_SECTION(), so they
      ended up with no __bug_table[] ...
      
      Ideally all those would use RW_DATA_SECTION() in their linker scripts,
      but that's for another day.
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: kbuild test robot <fengguang.wu@intel.com>
      Cc: kbuild-all@01.org
      Cc: tipbuild@zytor.com
      Link: http://lkml.kernel.org/r/20170330154927.o6qmgfp4bdhrajbm@hirez.programming.kicks-ass.netSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b5effd38
  5. 30 Mar, 2017 2 commits
    • Peter Zijlstra's avatar
      debug: Add _ONCE() logic to report_bug() · 19d43626
      Peter Zijlstra authored
      Josh suggested moving the _ONCE logic inside the trap handler, using a
      bit in the bug_entry::flags field, avoiding the need for the extra
      variable.
      
      Sadly this only works for WARN_ON_ONCE(), since the others have
      printk() statements prior to triggering the trap.
      
      Still, this saves a fair amount of text and some data:
      
        text         data       filename
        10682460     4530992    defconfig-build/vmlinux.orig
        10665111     4530096    defconfig-build/vmlinux.patched
      Suggested-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      19d43626
    • Arnd Bergmann's avatar
      x86/debug: Define BUG() again for !CONFIG_BUG · 70579a86
      Arnd Bergmann authored
      The latest change to the BUG() macro inadvertently reverted the earlier
      commit:
      
        b06dd879 ("x86: always define BUG() and HAVE_ARCH_BUG, even with !CONFIG_BUG")
      
      ... that sanitized the behavior with CONFIG_BUG=n.
      
      I noticed this as some warnings have appeared again that were previously
      fixed as a side effect of that patch:
      
        kernel/seccomp.c: In function '__seccomp_filter':
        kernel/seccomp.c:670:1: error: no return statement in function returning non-void [-Werror=return-type]
        ...
      
      This combines the two patches and uses the ud2 macro to define BUG()
      in case of CONFIG_BUG=n.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 9a93848f ("x86/debug: Implement __WARN() using UD0")
      Link: http://lkml.kernel.org/r/20170329211646.2707365-1-arnd@arndb.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      70579a86
  6. 27 Mar, 2017 1 commit
    • Peter Zijlstra's avatar
      x86/debug: Implement __WARN() using UD0 · 9a93848f
      Peter Zijlstra authored
      By using "UD0" for WARN()s we remove the function call and its possible
      __FILE__ and __LINE__ immediate arguments from the instruction stream.
      
      Total image size will not change much, what we win in the instruction
      stream we'll lose because of the __bug_table entries. Still, saves on
      I$ footprint and the total image size does go down a bit.
      
            text    data       filename
        10702123    4530992    defconfig-build/vmlinux.orig
        10682460    4530992    defconfig-build/vmlinux.patched
      
      (UML didn't seem to use GENERIC_BUG at all, so remove it)
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard.weinberger@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9a93848f
  7. 24 Mar, 2017 6 commits
  8. 23 Mar, 2017 1 commit
  9. 21 Mar, 2017 11 commits
  10. 20 Mar, 2017 10 commits
    • Arnd Bergmann's avatar
      remoteproc: qcom: fix QCOM_SMD dependencies · c3104aae
      Arnd Bergmann authored
      qcom_smd_register_edge() is provided by either QCOM_SMD or RPMSG_QCOM_SMD,
      and if both of them are disabled, it does nothing.
      
      The check for the PIL drivers however only checks for QCOM_SMD, so it breaks
      with QCOM_SMD=n && RPMSG_QCOM_SMD=m:
      
      drivers/remoteproc/built-in.o: In function `smd_subdev_remove':
      qcom_wcnss_iris.c:(.text+0x231c): undefined reference to `qcom_smd_unregister_edge'
      drivers/remoteproc/built-in.o: In function `smd_subdev_probe':
      qcom_wcnss_iris.c:(.text+0x2344): undefined reference to `qcom_smd_register_edge'
      drivers/remoteproc/built-in.o: In function `smd_subdev_probe':
      qcom_q6v5_pil.c:(.text+0x3538): undefined reference to `qcom_smd_register_edge'
      qcom_q6v5_pil.c:(.text+0x3538): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `qcom_smd_register_edge'
      
      This clarifies the Kconfig dependency.
      
      Fixes: 4b48921a ("remoteproc: qcom: Use common SMD edge handler")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      c3104aae
    • Chao Yu's avatar
      f2fs: combine nat_bits and free_nid_bitmap cache · 7041d5d2
      Chao Yu authored
      Both nat_bits cache and free_nid_bitmap cache provide same functionality
      as a intermediate cache between free nid cache and disk, but with
      different granularity of indicating free nid range, and different
      persistence policy. nat_bits cache provides better persistence ability,
      and free_nid_bitmap provides better granularity.
      
      In this patch we combine advantage of both caches, so finally policy of
      the intermediate cache would be:
      - init: load free nid status from nat_bits into free_nid_bitmap
      - lookup: scan free_nid_bitmap before load NAT blocks
      - update: update free_nid_bitmap in real-time
      - persistence: udpate and persist nat_bits in checkpoint
      
      This patch also resolves performance regression reported by lkp-robot.
      
      commit:
        4ac91242 ("f2fs: introduce free nid bitmap")
        d00030cf9cd0bb96fdccc41e33d3c91dcbb672ba ("f2fs: use __set{__clear}_bit_le")
        1382c0f3f9d3f936c8bc42ed1591cf7a593ef9f7 ("f2fs: combine nat_bits and free_nid_bitmap cache")
      
      4ac91242 d00030cf9cd0bb96fdccc41e33 1382c0f3f9d3f936c8bc42ed15
      ---------------- -------------------------- --------------------------
               %stddev     %change         %stddev     %change         %stddev
                   \          |                \          |                \
           77863 ±  0%      +2.1%      79485 ±  1%     +50.8%     117404 ±  0%  aim7.jobs-per-min
          231.63 ±  0%      -2.0%     227.01 ±  1%     -33.6%     153.80 ±  0%  aim7.time.elapsed_time
          231.63 ±  0%      -2.0%     227.01 ±  1%     -33.6%     153.80 ±  0%  aim7.time.elapsed_time.max
          896604 ±  0%      -0.8%     889221 ±  3%     -20.2%     715260 ±  1%  aim7.time.involuntary_context_switches
            2394 ±  1%      +4.6%       2503 ±  1%      +3.7%       2481 ±  2%  aim7.time.maximum_resident_set_size
            6240 ±  0%      -1.5%       6145 ±  1%     -14.1%       5360 ±  1%  aim7.time.system_time
         1111357 ±  3%      +1.9%    1132509 ±  2%      -6.2%    1041932 ±  2%  aim7.time.voluntary_context_switches
      ...
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Tested-by: default avatarXiaolong Ye <xiaolong.ye@intel.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      7041d5d2
    • Chao Yu's avatar
      f2fs: skip scanning free nid bitmap of full NAT blocks · 586d1492
      Chao Yu authored
      This patch adds to account free nids for each NAT blocks, and while
      scanning all free nid bitmap, do check count and skip lookuping in
      full NAT block.
      Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      586d1492
    • Jaegeuk Kim's avatar
      f2fs: use __set{__clear}_bit_le · 23380b85
      Jaegeuk Kim authored
      This patch uses __set{__clear}_bit_le for highter speed.
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      23380b85
    • Jaegeuk Kim's avatar
      f2fs: declare static functions · 9f7e4a2c
      Jaegeuk Kim authored
      This is to avoid build warning reported by kbuild test robot.
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      9f7e4a2c
    • Jaegeuk Kim's avatar
      f2fs: don't overwrite node block by SSR · 720037f9
      Jaegeuk Kim authored
      This patch fixes that SSR can overwrite previous warm node block consisting of
      a node chain since the last checkpoint.
      
      Fixes: 5b6c6be2 ("f2fs: use SSR for warm node as well")
      Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      720037f9
    • Linus Torvalds's avatar
      Linux 4.11-rc3 · 97da3854
      Linus Torvalds authored
      97da3854
    • Linus Torvalds's avatar
      mm/swap: don't BUG_ON() due to uninitialized swap slot cache · 452b94b8
      Linus Torvalds authored
      This BUG_ON() triggered for me once at shutdown, and I don't see a
      reason for the check.  The code correctly checks whether the swap slot
      cache is usable or not, so an uninitialized swap slot cache is not
      actually problematic afaik.
      
      I've temporarily just switched the BUG_ON() to a WARN_ON_ONCE(), since
      I'm not sure why that seemingly pointless check was there.  I suspect
      the real fix is to just remove it entirely, but for now we'll warn about
      it but not bring the machine down.
      
      Cc: "Huang, Ying" <ying.huang@intel.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      452b94b8
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.11-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a07a6e41
      Linus Torvalds authored
      Pull more powerpc fixes from Michael Ellerman:
       "A couple of minor powerpc fixes for 4.11:
      
         - wire up statx() syscall
      
         - don't print a warning on memory hotplug when HPT resizing isn't
           available
      
        Thanks to: David Gibson, Chandan Rajendra"
      
      * tag 'powerpc-4.11-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/pseries: Don't give a warning when HPT resizing isn't available
        powerpc: Wire up statx() syscall
      a07a6e41
    • Linus Torvalds's avatar
      Merge branch 'parisc-4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 4571bc5a
      Linus Torvalds authored
      Pull parisc fixes from Helge Deller:
      
       - Mikulas Patocka added support for R_PARISC_SECREL32 relocations in
         modules with CONFIG_MODVERSIONS.
      
       - Dave Anglin optimized the cache flushing for vmap ranges.
      
       - Arvind Yadav provided a fix for a potential NULL pointer dereference
         in the parisc perf code (and some code cleanups).
      
       - I wired up the new statx system call, fixed some compiler warnings
         with the access_ok() macro and fixed shutdown code to really halt a
         system at shutdown instead of crashing & rebooting.
      
      * 'parisc-4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Fix system shutdown halt
        parisc: perf: Fix potential NULL pointer dereference
        parisc: Avoid compiler warnings with access_ok()
        parisc: Wire up statx system call
        parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range
        parisc: support R_PARISC_SECREL32 relocation in modules
      4571bc5a