From: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH 3/7] memcg: immigrate charges only when a threadgroup leader is moved
Date: Mon, 25 May 2015 19:06:01 +0200 [thread overview]
Message-ID: <20150525170601.GA438@redhat.com> (raw)
In-Reply-To: <20150525160626.GC19389-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
On 05/25, Michal Hocko wrote:
>
> On Fri 22-05-15 20:30:42, Oleg Nesterov wrote:
> > On 05/22, Michal Hocko wrote:
> > >
> > > On Fri 22-05-15 18:29:00, Oleg Nesterov wrote:
> > > >
> > > > In the likely case (if CLONE_VM without CLONE_THREAD was not used) the
> > > > last for_each_process() in mm_update_next_owner() will find another thread
> > > > from the same group.
> > >
> > > My understanding was that for_each_process will iterate only over
> > > processes (represented by the thread group leaders).
> >
> > Yes. But note the inner for_each_thread() loop. And note that we
> > we need this loop exactly because the leader can be zombie.
>
> I was too vague, sorry about that.
Looks like, we confused each other somehow ;) Not sure I understand your
concerns...
But,
> What I meant was that
> for_each_process would pick up a group leader
Yes. In the case above it will find the caller (current) too,
> and the inner
> for_each_thread will return it as the first element in the list.
Yes, and this will be "current" task. But current->mm == NULL, so
for_each_thread() will continue and find another thread which becomes
the new mm->owner.
Just in case, note the BUG_ON(c == p). I think that BUG_ON(p->mm) at
the start will look much better. This is what mm_update_next_owner()
actually assumes.
Oleg.
WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>,
lizefan@huawei.com, cgroups@vger.kernel.org, hannes@cmpxchg.org,
linux-mm@kvack.org
Subject: Re: [PATCH 3/7] memcg: immigrate charges only when a threadgroup leader is moved
Date: Mon, 25 May 2015 19:06:01 +0200 [thread overview]
Message-ID: <20150525170601.GA438@redhat.com> (raw)
In-Reply-To: <20150525160626.GC19389@dhcp22.suse.cz>
On 05/25, Michal Hocko wrote:
>
> On Fri 22-05-15 20:30:42, Oleg Nesterov wrote:
> > On 05/22, Michal Hocko wrote:
> > >
> > > On Fri 22-05-15 18:29:00, Oleg Nesterov wrote:
> > > >
> > > > In the likely case (if CLONE_VM without CLONE_THREAD was not used) the
> > > > last for_each_process() in mm_update_next_owner() will find another thread
> > > > from the same group.
> > >
> > > My understanding was that for_each_process will iterate only over
> > > processes (represented by the thread group leaders).
> >
> > Yes. But note the inner for_each_thread() loop. And note that we
> > we need this loop exactly because the leader can be zombie.
>
> I was too vague, sorry about that.
Looks like, we confused each other somehow ;) Not sure I understand your
concerns...
But,
> What I meant was that
> for_each_process would pick up a group leader
Yes. In the case above it will find the caller (current) too,
> and the inner
> for_each_thread will return it as the first element in the list.
Yes, and this will be "current" task. But current->mm == NULL, so
for_each_thread() will continue and find another thread which becomes
the new mm->owner.
Just in case, note the BUG_ON(c == p). I think that BUG_ON(p->mm) at
the start will look much better. This is what mm_update_next_owner()
actually assumes.
Oleg.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-05-25 17:06 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 19:49 [PATCHSET cgroup/for-4.2] cgroup: make multi-process migration atomic Tejun Heo
2015-05-18 19:49 ` Tejun Heo
[not found] ` <1431978595-12176-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-05-18 19:49 ` [PATCH 1/7] cpuset: migrate memory only for threadgroup leaders Tejun Heo
2015-05-18 19:49 ` Tejun Heo
2015-05-18 19:49 ` [PATCH 2/7] memcg: restructure mem_cgroup_can_attach() Tejun Heo
2015-05-18 19:49 ` Tejun Heo
[not found] ` <1431978595-12176-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-05-19 9:03 ` Michal Hocko
2015-05-19 9:03 ` Michal Hocko
2015-05-18 19:49 ` [PATCH 3/7] memcg: immigrate charges only when a threadgroup leader is moved Tejun Heo
2015-05-18 19:49 ` Tejun Heo
[not found] ` <1431978595-12176-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-05-19 12:13 ` Michal Hocko
2015-05-19 12:13 ` Michal Hocko
[not found] ` <20150519121321.GB6203-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-19 13:10 ` Michal Hocko
2015-05-19 13:10 ` Michal Hocko
2015-05-19 21:27 ` Tejun Heo
2015-05-19 21:27 ` Tejun Heo
2015-05-20 13:10 ` Michal Hocko
2015-05-20 13:21 ` Michal Hocko
[not found] ` <20150520132158.GB28678-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-20 17:53 ` Oleg Nesterov
2015-05-20 17:53 ` Oleg Nesterov
2015-05-20 20:22 ` Michal Hocko
2015-05-20 20:22 ` Michal Hocko
[not found] ` <20150520202221.GD14256-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-21 17:22 ` Johannes Weiner
2015-05-21 17:22 ` Johannes Weiner
2015-05-22 9:34 ` Michal Hocko
2015-05-21 19:27 ` Oleg Nesterov
2015-05-21 19:27 ` Oleg Nesterov
[not found] ` <20150521192716.GA21304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-22 9:36 ` Michal Hocko
2015-05-22 9:36 ` Michal Hocko
[not found] ` <20150522093639.GE5109-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-22 16:29 ` Oleg Nesterov
2015-05-22 16:29 ` Oleg Nesterov
2015-05-22 16:57 ` Michal Hocko
2015-05-22 18:30 ` Oleg Nesterov
[not found] ` <20150522183042.GF26770-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-25 16:06 ` Michal Hocko
2015-05-25 16:06 ` Michal Hocko
[not found] ` <20150525160626.GC19389-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-25 17:06 ` Oleg Nesterov [this message]
2015-05-25 17:06 ` Oleg Nesterov
[not found] ` <20150525170601.GA438-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-26 7:16 ` Michal Hocko
2015-05-26 7:16 ` Michal Hocko
2015-05-22 18:20 ` [PATCH 0/3] memcg: mm_update_next_owner() cleanups Oleg Nesterov
[not found] ` <20150522182054.GA26770-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-22 18:21 ` [PATCH 1/3] memcg: introduce assign_new_owner() Oleg Nesterov
2015-05-22 18:21 ` Oleg Nesterov
2015-05-22 18:21 ` [PATCH 2/3] memcg: change assign_new_owner() to consider the sub-htreads Oleg Nesterov
2015-05-22 18:21 ` Oleg Nesterov
2015-05-22 18:21 ` [PATCH 3/3] memcg: change mm_update_next_owner() to search in sub-threads first Oleg Nesterov
2015-05-22 18:22 ` [PATCH 0/3] memcg: mm_update_next_owner() cleanups Oleg Nesterov
2015-05-21 14:12 ` [PATCH 3/7] memcg: immigrate charges only when a threadgroup leader is moved Michal Hocko
2015-05-21 14:12 ` Michal Hocko
[not found] ` <20150521141225.GB14475-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2015-05-21 22:09 ` Tejun Heo
2015-05-21 22:09 ` Tejun Heo
2015-05-18 19:49 ` [PATCH 4/7] cgroup, memcg, cpuset: implement cgroup_taskset_for_each_leader() Tejun Heo
2015-05-18 19:49 ` Tejun Heo
2015-05-18 19:49 ` [PATCH 5/7] reorder cgroup_migrate()'s parameters Tejun Heo
2015-05-18 19:49 ` Tejun Heo
2015-05-18 19:49 ` [PATCH 6/7] cgroup: separate out taskset operations from cgroup_migrate() Tejun Heo
2015-05-18 19:49 ` Tejun Heo
2015-05-18 19:49 ` [PATCH 7/7] cgroup: make cgroup_update_dfl_csses() migrate all target processes atomically Tejun Heo
2015-05-18 19:49 ` Tejun Heo
2015-05-19 6:57 ` [PATCHSET cgroup/for-4.2] cgroup: make multi-process migration atomic Zefan Li
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=20150525170601.GA438@redhat.com \
--to=oleg-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.