aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVipin Sharma <vipinsh@google.com>2022-02-22 05:48:48 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2022-02-25 08:20:14 -0500
commite45cce30eade14cdc1a98a9c1cd51f3294e3597b (patch)
treea8f1fc422944339c98ca664b5acda407ad68d56b /tools
parentKVM: VMX: Remove scratch 'cpu' variable that shadows an identical scratch var (diff)
downloadlinux-dev-e45cce30eade14cdc1a98a9c1cd51f3294e3597b.tar.xz
linux-dev-e45cce30eade14cdc1a98a9c1cd51f3294e3597b.zip
KVM: Move VM's worker kthreads back to the original cgroup before exiting.
VM worker kthreads can linger in the VM process's cgroup for sometime after KVM terminates the VM process. KVM terminates the worker kthreads by calling kthread_stop() which waits on the 'exited' completion, triggered by exit_mm(), via mm_release(), in do_exit() during the kthread's exit. However, these kthreads are removed from the cgroup using the cgroup_exit() which happens after the exit_mm(). Therefore, A VM process can terminate in between the exit_mm() and cgroup_exit() calls, leaving only worker kthreads in the cgroup. Moving worker kthreads back to the original cgroup (kthreadd_task's cgroup) makes sure that the cgroup is empty as soon as the main VM process is terminated. Signed-off-by: Vipin Sharma <vipinsh@google.com> Suggested-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220222054848.563321-1-vipinsh@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions