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
You need to sign in or sign up before continuing.
  • linux
  • include
  • linux
  • compiler.h
Find file BlameHistoryPermalink
  • Mikulas Patocka's avatar
    branch-check: fix long->int truncation when profiling branches · c0df075d
    Mikulas Patocka authored May 30, 2018
    BugLink: https://bugs.launchpad.net/bugs/1784382
    
    commit 2026d357 upstream.
    
    The function __builtin_expect returns long type (see the gcc
    documentation), and so do macros likely and unlikely. Unfortunatelly, when
    CONFIG_PROFILE_ANNOTATED_BRANCHES is selected, the macros likely and
    unlikely expand to __branch_check__ and __branch_check__ truncates the
    long type to int. This unintended truncation may cause bugs in various
    kernel code (we found a bug in dm-writecache because of it), so it's
    better to fix __branch_check__ to return long.
    
    Link: http://lkml.kernel.org/r/alpine.LRH.2.02.1805300818140.24812@file01.intranet.prod.int.rdu2.redhat.com
    
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: stable@vger.kernel.org
    Fixes: 1f0d69a9
    
     ("tracing: profile likely and unlikely annotations")
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
    Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
    c0df075d
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7