Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • kernel
  • panic.c
Find file BlameHistoryPermalink
  • Uros Bizjak's avatar
    panic: use atomic_try_cmpxchg in panic() and nmi_panic() · 9734fe4d
    Uros Bizjak authored Sep 04, 2023
    Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old
    in panic() and nmi_panic().  x86 CMPXCHG instruction returns success in ZF
    flag, so this change saves a compare after cmpxchg (and related move
    instruction in front of cmpxchg).
    
    Also, rename cpu variable to this_cpu in nmi_panic() and try to unify
    logic flow between panic() and nmi_panic().
    
    No functional change intended.
    
    [ubizjak@gmail.com: clean up if/else block]
      Link: https://lkml.kernel.org/r/20230906191200.68707-1-ubizjak@gmail.com
    Link: https://lkml.kernel.org/r/20230904152230.9227-1-ubizjak@gmail.com
    
    
    Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    9734fe4d
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7