1. 22 3月, 2019 1 次提交
  2. 15 3月, 2019 5 次提交
  3. 14 3月, 2019 1 次提交
  4. 13 3月, 2019 6 次提交
    • D
      tracing: kdb: Fix ftdump to not sleep · 31b265b3
      Douglas Anderson 提交于
      As reported back in 2016-11 [1], the "ftdump" kdb command triggers a
      BUG for "sleeping function called from invalid context".
      
      kdb's "ftdump" command wants to call ring_buffer_read_prepare() in
      atomic context.  A very simple solution for this is to add allocation
      flags to ring_buffer_read_prepare() so kdb can call it without
      triggering the allocation error.  This patch does that.
      
      Note that in the original email thread about this, it was suggested
      that perhaps the solution for kdb was to either preallocate the buffer
      ahead of time or create our own iterator.  I'm hoping that this
      alternative of adding allocation flags to ring_buffer_read_prepare()
      can be considered since it means I don't need to duplicate more of the
      core trace code into "trace_kdb.c" (for either creating my own
      iterator or re-preparing a ring allocator whose memory was already
      allocated).
      
      NOTE: another option for kdb is to actually figure out how to make it
      reuse the existing ftrace_dump() function and totally eliminate the
      duplication.  This sounds very appealing and actually works (the "sr
      z" command can be seen to properly dump the ftrace buffer).  The
      downside here is that ftrace_dump() fully consumes the trace buffer.
      Unless that is changed I'd rather not use it because it means "ftdump
      | grep xyz" won't be very useful to search the ftrace buffer since it
      will throw away the whole trace on the first grep.  A future patch to
      dump only the last few lines of the buffer will also be hard to
      implement.
      
      [1] https://lkml.kernel.org/r/20161117191605.GA21459@google.com
      
      Link: http://lkml.kernel.org/r/20190308193205.213659-1-dianders@chromium.orgReported-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      31b265b3
    • M
      memblock: drop memblock_alloc_*_nopanic() variants · 26fb3dae
      Mike Rapoport 提交于
      As all the memblock allocation functions return NULL in case of error
      rather than panic(), the duplicates with _nopanic suffix can be removed.
      
      Link: http://lkml.kernel.org/r/1548057848-15136-22-git-send-email-rppt@linux.ibm.comSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: Petr Mladek <pmladek@suse.com>		[printk]
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Guo Ren <ren_guo@c-sky.com>				[c-sky]
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Juergen Gross <jgross@suse.com>			[Xen]
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26fb3dae
    • M
      treewide: add checks for the return value of memblock_alloc*() · 8a7f97b9
      Mike Rapoport 提交于
      Add check for the return value of memblock_alloc*() functions and call
      panic() in case of error.  The panic message repeats the one used by
      panicing memblock allocators with adjustment of parameters to include
      only relevant ones.
      
      The replacement was mostly automated with semantic patches like the one
      below with manual massaging of format strings.
      
        @@
        expression ptr, size, align;
        @@
        ptr = memblock_alloc(size, align);
        + if (!ptr)
        + 	panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);
      
      [anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
        Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
      [rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
        Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
      [rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
        Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
      [akpm@linux-foundation.org: fix xtensa printk warning]
      Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.comSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Reviewed-by: Guo Ren <ren_guo@c-sky.com>		[c-sky]
      Acked-by: Paul Burton <paul.burton@mips.com>		[MIPS]
      Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>	[s390]
      Reviewed-by: Juergen Gross <jgross@suse.com>		[Xen]
      Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
      Acked-by: Max Filippov <jcmvbkbc@gmail.com>		[xtensa]
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a7f97b9
    • M
      swiotlb: add checks for the return value of memblock_alloc*() · a0bf842e
      Mike Rapoport 提交于
      Add panic() calls if memblock_alloc() returns NULL.
      
      The panic() format duplicates the one used by memblock itself and in
      order to avoid explosion with long parameters list replace open coded
      allocation size calculations with a local variable.
      
      Link: http://lkml.kernel.org/r/1548057848-15136-19-git-send-email-rppt@linux.ibm.comSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dennis Zhou <dennis@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Guo Ren <ren_guo@c-sky.com>				[c-sky]
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Juergen Gross <jgross@suse.com>			[Xen]
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0bf842e
    • Z
      kernel/sysctl.c: define minmax conv functions in terms of non-minmax versions · 2bc4fc60
      Zev Weiss 提交于
      do_proc_do[u]intvec_minmax_conv() had included open-coded versions of
      do_proc_do[u]intvec_conv(); the duplication led to buggy inconsistencies
      (missing range checks).  To reduce the likelihood of such problems in the
      future, we can instead refactor both to be defined in terms of their
      non-bounded counterparts (plus the added check).
      
      Link: http://lkml.kernel.org/r/20190207165138.5oud57vq4ozwb4kh@hatter.bewilderbeest.netSigned-off-by: NZev Weiss <zev@bewilderbeest.net>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2bc4fc60
    • Z
      kernel/sysctl.c: add missing range check in do_proc_dointvec_minmax_conv · 8cf7630b
      Zev Weiss 提交于
      This bug has apparently existed since the introduction of this function
      in the pre-git era (4500e91754d3 in Thomas Gleixner's history.git,
      "[NET]: Add proc_dointvec_userhz_jiffies, use it for proper handling of
      neighbour sysctls.").
      
      As a minimal fix we can simply duplicate the corresponding check in
      do_proc_dointvec_conv().
      
      Link: http://lkml.kernel.org/r/20190207123426.9202-3-zev@bewilderbeest.netSigned-off-by: NZev Weiss <zev@bewilderbeest.net>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: <stable@vger.kernel.org>	[2.6.2+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8cf7630b
  5. 12 3月, 2019 2 次提交
  6. 09 3月, 2019 6 次提交
    • Q
      workqueue, lockdep: Fix a memory leak in wq->lock_name · 69a106c0
      Qian Cai 提交于
      The following commit:
      
        669de8bd ("kernel/workqueue: Use dynamic lockdep keys for workqueues")
      
      introduced a memory leak as wq_free_lockdep() calls kfree(wq->lock_name),
      but wq_init_lockdep() does not point wq->lock_name to the newly allocated
      slab object.
      
      This can be reproduced by running LTP fallocate04 followed by oom01 tests:
      
       unreferenced object 0xc0000005876384d8 (size 64):
        comm "fallocate04", pid 26972, jiffies 4297139141 (age 40370.480s)
        hex dump (first 32 bytes):
          28 77 71 5f 63 6f 6d 70 6c 65 74 69 6f 6e 29 65  (wq_completion)e
          78 74 34 2d 72 73 76 2d 63 6f 6e 76 65 72 73 69  xt4-rsv-conversi
        backtrace:
          [<00000000cb452883>] kvasprintf+0x6c/0xe0
          [<000000004654ddac>] kasprintf+0x34/0x60
          [<000000001c68f311>] alloc_workqueue+0x1f8/0x6ac
          [<0000000003c2ad83>] ext4_fill_super+0x23d4/0x3c80 [ext4]
          [<0000000006610538>] mount_bdev+0x25c/0x290
          [<00000000bcf955ec>] ext4_mount+0x28/0x50 [ext4]
          [<0000000016e08fd3>] legacy_get_tree+0x4c/0xb0
          [<0000000042b6a5fc>] vfs_get_tree+0x6c/0x190
          [<00000000268ab022>] do_mount+0xb9c/0x1100
          [<00000000698e6898>] ksys_mount+0x158/0x180
          [<0000000064e391fd>] sys_mount+0x20/0x30
          [<00000000ba378f12>] system_call+0x5c/0x70
      Signed-off-by: NQian Cai <cai@lca.pw>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NBart Van Assche <bvanassche@acm.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: catalin.marinas@arm.com
      Cc: jiangshanlai@gmail.com
      Cc: tj@kernel.org
      Fixes: 669de8bd ("kernel/workqueue: Use dynamic lockdep keys for workqueues")
      Link: https://lkml.kernel.org/r/20190307002731.47371-1-cai@lca.pwSigned-off-by: NIngo Molnar <mingo@kernel.org>
      69a106c0
    • B
      workqueue, lockdep: Fix an alloc_workqueue() error path · 009bb421
      Bart Van Assche 提交于
      This patch fixes a use-after-free and a memory leak in an alloc_workqueue()
      error path.
      
      Repoted by syzkaller and KASAN:
      
        BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:197 [inline]
        BUG: KASAN: use-after-free in lockdep_register_key+0x3b9/0x490 kernel/locking/lockdep.c:1023
        Read of size 8 at addr ffff888090fc2698 by task syz-executor134/7858
      
        CPU: 1 PID: 7858 Comm: syz-executor134 Not tainted 5.0.0-rc8-next-20190301 #1
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        Call Trace:
         __dump_stack lib/dump_stack.c:77 [inline]
         dump_stack+0x172/0x1f0 lib/dump_stack.c:113
         print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187
         kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
         __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
         __read_once_size include/linux/compiler.h:197 [inline]
         lockdep_register_key+0x3b9/0x490 kernel/locking/lockdep.c:1023
         wq_init_lockdep kernel/workqueue.c:3444 [inline]
         alloc_workqueue+0x427/0xe70 kernel/workqueue.c:4263
         ucma_open+0x76/0x290 drivers/infiniband/core/ucma.c:1732
         misc_open+0x398/0x4c0 drivers/char/misc.c:141
         chrdev_open+0x247/0x6b0 fs/char_dev.c:417
         do_dentry_open+0x488/0x1160 fs/open.c:771
         vfs_open+0xa0/0xd0 fs/open.c:880
         do_last fs/namei.c:3416 [inline]
         path_openat+0x10e9/0x46e0 fs/namei.c:3533
         do_filp_open+0x1a1/0x280 fs/namei.c:3563
         do_sys_open+0x3fe/0x5d0 fs/open.c:1063
         __do_sys_openat fs/open.c:1090 [inline]
         __se_sys_openat fs/open.c:1084 [inline]
         __x64_sys_openat+0x9d/0x100 fs/open.c:1084
         do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
        Allocated by task 7789:
         save_stack+0x45/0xd0 mm/kasan/common.c:75
         set_track mm/kasan/common.c:87 [inline]
         __kasan_kmalloc mm/kasan/common.c:497 [inline]
         __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470
         kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511
         __do_kmalloc mm/slab.c:3726 [inline]
         __kmalloc+0x15c/0x740 mm/slab.c:3735
         kmalloc include/linux/slab.h:553 [inline]
         kzalloc include/linux/slab.h:743 [inline]
         alloc_workqueue+0x13c/0xe70 kernel/workqueue.c:4236
         ucma_open+0x76/0x290 drivers/infiniband/core/ucma.c:1732
         misc_open+0x398/0x4c0 drivers/char/misc.c:141
         chrdev_open+0x247/0x6b0 fs/char_dev.c:417
         do_dentry_open+0x488/0x1160 fs/open.c:771
         vfs_open+0xa0/0xd0 fs/open.c:880
         do_last fs/namei.c:3416 [inline]
         path_openat+0x10e9/0x46e0 fs/namei.c:3533
         do_filp_open+0x1a1/0x280 fs/namei.c:3563
         do_sys_open+0x3fe/0x5d0 fs/open.c:1063
         __do_sys_openat fs/open.c:1090 [inline]
         __se_sys_openat fs/open.c:1084 [inline]
         __x64_sys_openat+0x9d/0x100 fs/open.c:1084
         do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
        Freed by task 7789:
         save_stack+0x45/0xd0 mm/kasan/common.c:75
         set_track mm/kasan/common.c:87 [inline]
         __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459
         kasan_slab_free+0xe/0x10 mm/kasan/common.c:467
         __cache_free mm/slab.c:3498 [inline]
         kfree+0xcf/0x230 mm/slab.c:3821
         alloc_workqueue+0xc3e/0xe70 kernel/workqueue.c:4295
         ucma_open+0x76/0x290 drivers/infiniband/core/ucma.c:1732
         misc_open+0x398/0x4c0 drivers/char/misc.c:141
         chrdev_open+0x247/0x6b0 fs/char_dev.c:417
         do_dentry_open+0x488/0x1160 fs/open.c:771
         vfs_open+0xa0/0xd0 fs/open.c:880
         do_last fs/namei.c:3416 [inline]
         path_openat+0x10e9/0x46e0 fs/namei.c:3533
         do_filp_open+0x1a1/0x280 fs/namei.c:3563
         do_sys_open+0x3fe/0x5d0 fs/open.c:1063
         __do_sys_openat fs/open.c:1090 [inline]
         __se_sys_openat fs/open.c:1084 [inline]
         __x64_sys_openat+0x9d/0x100 fs/open.c:1084
         do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
        The buggy address belongs to the object at ffff888090fc2580
         which belongs to the cache kmalloc-512 of size 512
        The buggy address is located 280 bytes inside of
         512-byte region [ffff888090fc2580, ffff888090fc2780)
      
      Reported-by: syzbot+17335689e239ce135d8b@syzkaller.appspotmail.com
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Fixes: 669de8bd ("kernel/workqueue: Use dynamic lockdep keys for workqueues")
      Link: https://lkml.kernel.org/r/20190303220046.29448-1-bvanassche@acm.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      009bb421
    • B
      locking/lockdep: Only call init_rcu_head() after RCU has been initialized · 0126574f
      Bart Van Assche 提交于
      init_data_structures_once() is called for the first time before RCU has
      been initialized. Make sure that init_rcu_head() is called before the
      RCU head is used and after RCU has been initialized.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: longman@redhat.com
      Link: https://lkml.kernel.org/r/c20aa0f0-42ab-a884-d931-7d4ec2bf0cdc@acm.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      0126574f
    • A
      locking/lockdep: Avoid a Clang warning · 3fe7522f
      Arnd Bergmann 提交于
      Clang warns about a tentative array definition without a length:
      
        kernel/locking/lockdep.c:845:12: error: tentative array definition assumed to have one element [-Werror]
      
      There is no real reason to do this here, so just set the same length as
      in the real definition later in the same file.  It has to be hidden in
      an #ifdef or annotated __maybe_unused though, to avoid the unused-variable
      warning if CONFIG_PROVE_LOCKING is disabled.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Frederic Weisbecker <frederic@kernel.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Waiman Long <longman@redhat.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://lkml.kernel.org/r/20190307075222.3424524-1-arnd@arndb.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      3fe7522f
    • G
      perf/core: Mark expected switch fall-through · 43aa378b
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      This patch fixes the following warning:
      
        kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
        kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
            kernel = 1;
            ~~~~~~~^~~
        kernel/events/core.c:9156:3: note: here
           case IF_SRC_FILEADDR:
           ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: https://lkml.kernel.org/r/20190212205430.GA8446@embeddedorSigned-off-by: NIngo Molnar <mingo@kernel.org>
      43aa378b
    • A
      perf/ring_buffer: Use high order allocations for AUX buffers optimistically · 5768402f
      Alexander Shishkin 提交于
      Currently, the AUX buffer allocator will use high-order allocations
      for PMUs that don't support hardware scatter-gather chaining to ensure
      large contiguous blocks of pages, and always use an array of single
      pages otherwise.
      
      There is, however, a tangible performance benefit in using larger chunks
      of contiguous memory even in the latter case, that comes from not having
      to fetch the next page's address at every page boundary. In particular,
      a task running under Intel PT on an Atom CPU shows 1.5%-2% less runtime
      penalty with a single multi-page output region in snapshot mode (no PMI)
      than with multiple single-page output regions, from ~6% down to ~4%. For
      the snapshot mode it does make a difference as it is intended to run over
      long periods of time.
      
      For this reason, change the allocation policy to always optimistically
      start with the highest possible order when allocating pages for the AUX
      buffer, desceding until the allocation succeeds or order zero allocation
      fails.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: https://lkml.kernel.org/r/20190215114727.62648-2-alexander.shishkin@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      5768402f
  7. 08 3月, 2019 15 次提交
  8. 07 3月, 2019 4 次提交