cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Tejun Heo <tj@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Vipin Sharma <vipinsh@google.com>,
	seanjc@google.com, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	dmatlack@google.com, jiangshanlai@gmail.com, kvm@vger.kernel.org,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: Move VM's worker kthreads back to the original cgroups before exiting.
Date: Thu, 20 Jan 2022 16:05:02 +0100	[thread overview]
Message-ID: <20220120150502.GC27269@blackbody.suse.cz> (raw)
In-Reply-To: <YehY0z2vHYVZk52J@slm.duckdns.org>

On Wed, Jan 19, 2022 at 08:30:43AM -1000, Tejun Heo <tj@kernel.org> wrote:
> It'd be nicer if we can make kthread_stop() waiting more regular but I
> couldn't find a good existing place and routing the usual parent
> signaling might be too complicated. Anyone has better ideas?

The regular way is pictured in Paolo's diagram already, the
exit_notify/do_signal_parent -> wait4 path.

Actually, I can see that there exists already kernel_wait() and is used
by a UMH wrapper kthread. kthreadd issues ignore_signals() so (besides
no well defined point of signalling a kthread) the signal notification
is moot and only waking up the waiter is relevant. So kthread_stop()
could wait via kernel_wait() based on pid (extracted from task_struct).

Have I missed an obstacle?


Michal

  parent reply	other threads:[~2022-01-20 15:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 22:53 [PATCH v2] KVM: Move VM's worker kthreads back to the original cgroups before exiting Vipin Sharma
     [not found] ` <20211222225350.1912249-1-vipinsh-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2021-12-28 17:17   ` Sean Christopherson
     [not found]     ` <YctGtWzYcNP2iTaN-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-01-18 19:53       ` Vipin Sharma
2022-01-05 18:04   ` Michal Koutný
2022-01-18 20:25     ` Vipin Sharma
     [not found]       ` <CAHVum0e84nUcGtdPYQaJDQszKj-QVP5gM+nteBpSTaQ2sWYpmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-18 20:39         ` Tejun Heo
2022-01-19 18:02           ` Paolo Bonzini
     [not found]             ` <7a0bc562-9f25-392d-5c05-9dbcd350d002-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2022-01-19 18:30               ` Tejun Heo
     [not found]                 ` <YehY0z2vHYVZk52J-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2022-01-19 18:49                   ` Vipin Sharma
2022-01-19 19:05                     ` Tejun Heo
2022-01-20 15:05                 ` Michal Koutný [this message]
     [not found]                   ` <20220120150502.GC27269-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>
2022-02-16 17:37                     ` Vipin Sharma
     [not found]                       ` <CAHVum0fOP-2XcUcG3PqW08DY7CmpDroG6Fcv9KoD1FqLmGpB8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-16 19:48                         ` Paolo Bonzini
2022-02-25 17:37                       ` Michal Koutný

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=20220120150502.GC27269@blackbody.suse.cz \
    --to=mkoutny@suse.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dmatlack@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=jiangshanlai@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tj@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).