Skip to content
Snippets Groups Projects
Select Git revision
  • 0e11d256512c5166e03c9e9f221f9371bd42911e
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

qspinlock_stat.h

  • Davidlohr Bueso's avatar
    66876595
    locking/pvqspinlock: Fix division by zero in qstat_read() · 66876595
    Davidlohr Bueso authored
    
    While playing with the qstat statistics (in <debugfs>/qlockstat/) I ran into
    the following splat on a VM when opening pv_hash_hops:
    
      divide error: 0000 [#1] SMP
      ...
      RIP: 0010:[<ffffffff810b61fe>]  [<ffffffff810b61fe>] qstat_read+0x12e/0x1e0
      ...
      Call Trace:
        [<ffffffff811cad7c>] ? mem_cgroup_commit_charge+0x6c/0xd0
        [<ffffffff8119750c>] ? page_add_new_anon_rmap+0x8c/0xd0
        [<ffffffff8118d3b9>] ? handle_mm_fault+0x1439/0x1b40
        [<ffffffff811937a9>] ? do_mmap+0x449/0x550
        [<ffffffff811d3de3>] ? __vfs_read+0x23/0xd0
        [<ffffffff811d4ab2>] ? rw_verify_area+0x52/0xd0
        [<ffffffff811d4bb1>] ? vfs_read+0x81/0x120
        [<ffffffff811d5f12>] ? SyS_read+0x42/0xa0
        [<ffffffff815720f6>] ? entry_SYSCALL_64_fastpath+0x1e/0xa8
    
    Fix this by verifying that qstat_pv_kick_unlock is in fact non-zero,
    similarly to what the qstat_pv_latency_wake case does, as if nothing
    else, this can come from resetting the statistics, thus having 0 kicks
    should be quite valid in this context.
    
    Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
    Reviewed-by: default avatarWaiman Long <Waiman.Long@hpe.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: dave@stgolabs.net
    Cc: waiman.long@hpe.com
    Link: http://lkml.kernel.org/r/1460961103-24953-1-git-send-email-dave@stgolabs.net
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    66876595
    History
    locking/pvqspinlock: Fix division by zero in qstat_read()
    Davidlohr Bueso authored
    
    While playing with the qstat statistics (in <debugfs>/qlockstat/) I ran into
    the following splat on a VM when opening pv_hash_hops:
    
      divide error: 0000 [#1] SMP
      ...
      RIP: 0010:[<ffffffff810b61fe>]  [<ffffffff810b61fe>] qstat_read+0x12e/0x1e0
      ...
      Call Trace:
        [<ffffffff811cad7c>] ? mem_cgroup_commit_charge+0x6c/0xd0
        [<ffffffff8119750c>] ? page_add_new_anon_rmap+0x8c/0xd0
        [<ffffffff8118d3b9>] ? handle_mm_fault+0x1439/0x1b40
        [<ffffffff811937a9>] ? do_mmap+0x449/0x550
        [<ffffffff811d3de3>] ? __vfs_read+0x23/0xd0
        [<ffffffff811d4ab2>] ? rw_verify_area+0x52/0xd0
        [<ffffffff811d4bb1>] ? vfs_read+0x81/0x120
        [<ffffffff811d5f12>] ? SyS_read+0x42/0xa0
        [<ffffffff815720f6>] ? entry_SYSCALL_64_fastpath+0x1e/0xa8
    
    Fix this by verifying that qstat_pv_kick_unlock is in fact non-zero,
    similarly to what the qstat_pv_latency_wake case does, as if nothing
    else, this can come from resetting the statistics, thus having 0 kicks
    should be quite valid in this context.
    
    Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
    Reviewed-by: default avatarWaiman Long <Waiman.Long@hpe.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: dave@stgolabs.net
    Cc: waiman.long@hpe.com
    Link: http://lkml.kernel.org/r/1460961103-24953-1-git-send-email-dave@stgolabs.net
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>