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
  • sys.c
Find file BlameHistoryPermalink
  • Oleg Nesterov's avatar
    getrusage: move thread_group_cputime_adjusted() outside of lock_task_sighand() · daa694e4
    Oleg Nesterov authored Jan 22, 2024
    Patch series "getrusage: use sig->stats_lock", v2.
    
    
    This patch (of 2):
    
    thread_group_cputime() does its own locking, we can safely shift
    thread_group_cputime_adjusted() which does another for_each_thread loop
    outside of ->siglock protected section.
    
    This is also preparation for the next patch which changes getrusage() to
    use stats_lock instead of siglock, thread_group_cputime() takes the same
    lock.  With the current implementation recursive read_seqbegin_or_lock()
    is fine, thread_group_cputime() can't enter the slow mode if the caller
    holds stats_lock, yet this looks more safe and better performance-wise.
    
    Link: https://lkml.kernel.org/r/20240122155023.GA26169@redhat.com
    Link: https://lkml.kernel.org/r/20240122155050.GA26205@redhat.com
    
    
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Reported-by: default avatarDylan Hatch <dylanbhatch@google.com>
    Tested-by: default avatarDylan Hatch <dylanbhatch@google.com>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    daa694e4
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7