mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: lizefan@huawei.com
Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] cgroup: update cgroup_transfer_tasks() to either succeed or fail
Date: Wed, 12 Feb 2014 10:30:33 -0500	[thread overview]
Message-ID: <20140212153033.GA26809@htj.dyndns.org> (raw)
In-Reply-To: <1392063694-26465-6-git-send-email-tj@kernel.org>

On Mon, Feb 10, 2014 at 03:21:34PM -0500, Tejun Heo wrote:
> cgroup_transfer_tasks() can currently fail in the middle due to memory
> allocation failure.  When that happens, the function just aborts and
> returns error code and there's no way to tell how many actually got
> migrated at the point of failure and or to revert the partial
> migration.
> 
> Update it to use cgroup_migrate{_add_src|prepare_dst|migrate|finish}()
> so that the function either succeeds or fails as a whole as long as
> ->can_attach() doesn't fail.

While this solves one aspect of the problem, it may still race with
fork and may leave newly forked tasks behind.  I'll think more about
it.

Thanks.

-- 
tejun

      reply	other threads:[~2014-02-12 15:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 20:21 [PATCHSET cgroup/for-3.15] cgroup: update task migration path Tejun Heo
2014-02-10 20:21 ` [PATCH 1/5] cgroup: add css_set->mg_tasks Tejun Heo
2014-02-10 20:21 ` [PATCH 2/5] cgroup: use css_set->mg_tasks to track target tasks during migration Tejun Heo
2014-02-10 20:21 ` [PATCH 3/5] cgroup: separate out cset_group_from_root() from task_cgroup_from_root() Tejun Heo
2014-02-10 20:21 ` [PATCH 4/5] cgroup: split process / task migration into four steps Tejun Heo
2014-02-10 20:21 ` [PATCH 5/5] cgroup: update cgroup_transfer_tasks() to either succeed or fail Tejun Heo
2014-02-12 15:30   ` Tejun Heo [this message]

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=20140212153033.GA26809@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.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®