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
  • fork.c
Find file BlameHistoryPermalink
  • Mike Christie's avatar
    fork: add kernel_clone_args flag to not dup/clone files · 11f3f500
    Mike Christie authored Mar 10, 2023
    
    
    Each vhost device gets a thread that is used to perform IO and management
    operations. Instead of a thread that is accessing a device, the thread is
    part of the device, so when it creates a thread using a helper based on
    copy_process we can't dup or clone the parent's files/FDS because it
    would do an extra increment on ourself.
    
    Later, when we do:
    
    Qemu process exits:
            do_exit -> exit_files -> put_files_struct -> close_files
    
    we would leak the device's resources because of that extra refcount
    on the fd or file_struct.
    
    This patch adds a no_files option so these worker threads can prevent
    taking an extra refcount on themselves.
    
    Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
    Acked-by: default avatarChristian Brauner <brauner@kernel.org>
    Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
    11f3f500
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7