From: Paolo Bonzini <pbonzini@redhat.com>
To: Vipin Sharma <vipinsh@google.com>,
seanjc@google.com, "Michael S. Tsirkin" <mst@redhat.com>
Cc: dmatlack@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: Move VM's worker kthreads back to the original cgroups before exiting.
Date: Wed, 15 Dec 2021 19:27:44 +0100 [thread overview]
Message-ID: <ac81dcba-13db-8286-0f2e-f46a413a09cf@redhat.com> (raw)
In-Reply-To: <20211214050708.4040200-1-vipinsh@google.com>
On 12/14/21 06:07, Vipin Sharma wrote:
>
> KVM terminates the worker kthreads by calling kthread_stop() which waits
> on the signal generated by exit_mm() in do_exit() during kthread's exit.
Instead of "signal", please spell it as "the 'exited' completion,
triggered by exit_mm(), via mm_release(), during the kthread's exit".
That makes things a bit clearer.
So the issue is that the kthread_stop happens around the time
exit_task_work() destroys the VM, but the process can go on and signal
its demise to the parent process before the kthread has been completely
dropped. Not even close() can fix it, though it may reduce the window
completely, so I agree that this is a bug and vhost has the same bug too.
Due to the issue with kthreadd_task not being exported, perhaps you can
change cgroup_attach_task_all to use kthreadd_task if the "from"
argument is NULL?
Paolo
next prev parent reply other threads:[~2021-12-15 18:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 5:07 Vipin Sharma
2021-12-14 15:46 ` kernel test robot
2021-12-14 16:14 ` Lai Jiangshan
2021-12-22 20:14 ` Vipin Sharma
2021-12-14 17:16 ` Sean Christopherson
2021-12-15 3:58 ` Vipin Sharma
2021-12-14 17:44 ` kernel test robot
2021-12-15 18:27 ` Paolo Bonzini [this message]
2021-12-22 20:12 ` Vipin Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac81dcba-13db-8286-0f2e-f46a413a09cf@redhat.com \
--to=pbonzini@redhat.com \
--cc=dmatlack@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=seanjc@google.com \
--cc=vipinsh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®