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
  • locking
  • rtmutex.c
Find file BlameHistoryPermalink
  • Davidlohr Bueso's avatar
    locking/rtmutex: Optimize setting task running after being blocked · afffc6c1
    Davidlohr Bueso authored Feb 01, 2015
    
    
    We explicitly mark the task running after returning from
    a __rt_mutex_slowlock() call, which does the actual sleeping
    via wait-wake-trylocking. As such, this patch does two things:
    
    (1) refactors the code so that setting current to TASK_RUNNING
        is done by __rt_mutex_slowlock(), and not by the callers. The
        downside to this is that it becomes a bit unclear when at what
        point we block. As such I've added a comment that the task
        blocks when calling __rt_mutex_slowlock() so readers can figure
        out when it is running again.
    
    (2) relaxes setting current's state through __set_current_state(),
        instead of it's more expensive barrier alternative. There was no
        need for the implied barrier as we're obviously not planning on
        blocking.
    
    Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/1422857784.18096.1.camel@stgolabs.net
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    afffc6c1
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7