All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haifeng Xu <haifeng.xu@shopee.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cgroup: Simplify code in css_set_move_task
Date: Thu, 3 Nov 2022 10:13:22 +0800	[thread overview]
Message-ID: <25f6a188-4cc6-dace-1468-fd5645711515@shopee.com> (raw)
In-Reply-To: <20221031131140.GC27841@blackbody.suse.cz>



On 2022/10/31 21:11, Michal Koutný wrote:
> Hello.
> 
>> 1) If calls 'css_set_update_populated' , the cset is either getting the
>> first task or losing the last. There is a need to update the populated
>> state of the cset only when 'css_set_populated' returns false.
>> In other words, the last has been deleted from from_cset and the first
>> hasn't been added to to_cset yet.
> 
> I've likely misread the condition previously. I see how this works now
> (update happens after "from_cset" but before "to_cset" migration).
> 
>> 3) In order to update the populated state of to_cset the same way
>> from_cset does, 'css_set_update_populated' is also invoked during the
>> process of moving a task to to_cset.
> 
> As I think more about this in the context of vertical migrations
> (ancestor<->descendant, such as during controller dis- or enablement),
> I'm afraid the inverted order would lead to "spurious" emptiness
> notifications in ancestors (in the case a there is just a single task
> that migrates parent->child, parent/cgroup.populated would generate and
> event that'd be nullified by the subsequent population of the child).
Hi, Michal.

I understand your worries. Can I just check the populated state of
css_set in 'css_set_update_populated' and don't change the order any
more? I think it can also streamline 'css_set_move_task' a bit.

Thanks,
Hiafeng.
> 
> So I'm not sure the change is worth it.
> 
> Michal

WARNING: multiple messages have this Message-ID (diff)
From: Haifeng Xu <haifeng.xu-LL2PKPoSiP3QT0dZR+AlfA@public.gmane.org>
To: "Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>
Cc: tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cgroup: Simplify code in css_set_move_task
Date: Thu, 3 Nov 2022 10:13:22 +0800	[thread overview]
Message-ID: <25f6a188-4cc6-dace-1468-fd5645711515@shopee.com> (raw)
In-Reply-To: <20221031131140.GC27841-9OudH3eul5jcvrawFnH+a6VXKuFTiq87@public.gmane.org>



On 2022/10/31 21:11, Michal Koutný wrote:
> Hello.
> 
>> 1) If calls 'css_set_update_populated' , the cset is either getting the
>> first task or losing the last. There is a need to update the populated
>> state of the cset only when 'css_set_populated' returns false.
>> In other words, the last has been deleted from from_cset and the first
>> hasn't been added to to_cset yet.
> 
> I've likely misread the condition previously. I see how this works now
> (update happens after "from_cset" but before "to_cset" migration).
> 
>> 3) In order to update the populated state of to_cset the same way
>> from_cset does, 'css_set_update_populated' is also invoked during the
>> process of moving a task to to_cset.
> 
> As I think more about this in the context of vertical migrations
> (ancestor<->descendant, such as during controller dis- or enablement),
> I'm afraid the inverted order would lead to "spurious" emptiness
> notifications in ancestors (in the case a there is just a single task
> that migrates parent->child, parent/cgroup.populated would generate and
> event that'd be nullified by the subsequent population of the child).
Hi, Michal.

I understand your worries. Can I just check the populated state of
css_set in 'css_set_update_populated' and don't change the order any
more? I think it can also streamline 'css_set_move_task' a bit.

Thanks,
Hiafeng.
> 
> So I'm not sure the change is worth it.
> 
> Michal

  reply	other threads:[~2022-11-03  2:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  7:47 [PATCH] cgroup: Simplify code in css_set_move_task haifeng.xu
2022-10-20  7:47 ` haifeng.xu
2022-10-27  8:05 ` Michal Koutný
2022-10-27  8:05   ` Michal Koutný
2022-10-28 11:29   ` Haifeng Xu
2022-10-28 11:29     ` Haifeng Xu
2022-10-31 13:11     ` Michal Koutný
2022-10-31 13:11       ` Michal Koutný
2022-11-03  2:13       ` Haifeng Xu [this message]
2022-11-03  2:13         ` Haifeng Xu
2022-11-03  2:31         ` Tejun Heo
2022-11-03  2:31           ` Tejun Heo
2022-11-03 14:55           ` Haifeng Xu

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=25f6a188-4cc6-dace-1468-fd5645711515@shopee.com \
    --to=haifeng.xu@shopee.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mkoutny@suse.com \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.