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
  • kernel
  • exit.c
Find file BlameHistoryPermalink
  • Prateek Sood's avatar
    sched/wait: Fix rcuwait_wake_up() ordering · 635d29f4
    Prateek Sood authored Nov 30, 2018
    [ Upstream commit 6dc080ee
    
     ]
    
    For some peculiar reason rcuwait_wake_up() has the right barrier in
    the comment, but not in the code.
    
    This mistake has been observed to cause a deadlock in the following
    situation:
    
        P1					P2
    
        percpu_up_read()			percpu_down_write()
          rcu_sync_is_idle() // false
    					  rcu_sync_enter()
    					  ...
          __percpu_up_read()
    
    [S] ,-  __this_cpu_dec(*sem->read_count)
        |   smp_rmb();
    [L] |   task = rcu_dereference(w->task) // NULL
        |
        |				    [S]	    w->task = current
        |					    smp_mb();
        |				    [L]	    readers_active_check() // fail
        `-> <store happens here>
    
    Where the smp_rmb() (obviously) fails to constrain the store.
    
    [ peterz: Added changelog. ]
    
    Signed-off-by: default avatarPrateek Sood <prsood@codeaurora.org>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: default avatarAndrea Parri <andrea.parri@amarulasolutions.com>
    Acked-by: default avatarDavidlohr Bueso <dbueso@suse.de>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 8f95c90c ("sched/wait, RCU: Introduce rcuwait machinery")
    Link: https://lkml.kernel.org/r/1543590656-7157-1-git-send-email-prsood@codeaurora.org
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    635d29f4
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7