Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-dm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-dm
  • Repository
Switch branch/tag
  • linux-dm
  • kernel
  • sched
  • psi.c
Find file BlameHistoryPermalink
  • Jason Xing's avatar
    psi: get poll_work to run when calling poll syscall next time · 7b2b55da
    Jason Xing authored Aug 24, 2019
    Only when calling the poll syscall the first time can user receive
    POLLPRI correctly.  After that, user always fails to acquire the event
    signal.
    
    Reproduce case:
     1. Get the monitor code in Documentation/accounting/psi.txt
     2. Run it, and wait for the event triggered.
     3. Kill and restart the process.
    
    The question is why we can end up with poll_scheduled = 1 but the work
    not running (which would reset it to 0).  And the answer is because the
    scheduling side sees group->poll_kworker under RCU protection and then
    schedules it, but here we cancel the work and destroy the worker.  The
    cancel needs to pair with resetting the poll_scheduled flag.
    
    Link: http://lkml.kernel.org/r/1566357985-97781-1-git-send-email-joseph.qi@linux.alibaba.com
    
    
    Signed-off-by: default avatarJason Xing <kerneljasonxing@linux.alibaba.com>
    Signed-off-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
    Reviewed-by: default avatarCaspar Zhang <caspar@linux.alibaba.com>
    Reviewed-by: default avatarSuren Baghdasaryan <surenb@google.com>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7b2b55da