Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212639

Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating

From Aleksa Sarai <cyphar@cyphar.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating
Date 2015-08-25 04:10 +0200
Message-ID <q1bQu-10P-3@gated-at.bofh.it> (permalink)
References <q0Czn-HK-5@gated-at.bofh.it> <q0DlL-1Rq-3@gated-at.bofh.it> <q0DlN-1Rq-33@gated-at.bofh.it> <q14YF-7E8-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> Have you verified that the scenario you're describing can actually
> happen?  AFAICS, cgroup_migrate_add_src() already does the pinning.

Hmmm. Looking at it, group_migrate_add_src() does grab a ref on the
css_set which contains the css, and the comments mention that grabbing
a ref on the css_set will stop the css from being dropped. I must've
misunderstood one of your previous emails (where you said that such
code was not safe in the ->can_fork(), ->cancel_fork() and ->fork())
path.

You also mentioned that depending on the css_set's ref being bumped to
protect the contained csses is "sort of implementation detail.  It can
be implemented in different ways." Which made me think that depending
on that is not a good idea.

But if it's safe to depend on the cgroup_migrate_add_src() pinning the
ref on the css_set, I'll drop this patch and fix up the other one
accordingly.

-- 
Aleksa Sarai (cyphar)
www.cyphar.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RE: Bad Reference Semantics in PIDs Controller. Aleksa Sarai <cyphar@cyphar.com> - 2015-08-23 14:30 +0200
  Re: [PATCH 0/2] cgroup: pids: fix invalid reference semantics Aleksa Sarai <cyphar@cyphar.com> - 2015-08-23 15:20 +0200
  [PATCH 1/2] cgroup: get a ref to source csses when migrating Aleksa Sarai <cyphar@cyphar.com> - 2015-08-23 15:20 +0200
    Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating Tejun Heo <tj@kernel.org> - 2015-08-24 20:50 +0200
      Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating Aleksa Sarai <cyphar@cyphar.com> - 2015-08-25 04:10 +0200
        Re: [PATCH 1/2] cgroup: get a ref to source csses when migrating Tejun Heo <tj@kernel.org> - 2015-08-25 20:20 +0200
  [PATCH 0/2] cgroup: pids: fix invalid reference semantics Aleksa Sarai <cyphar@cyphar.com> - 2015-08-23 15:20 +0200
    [PATCH 2/2] cgroup: pids: fix invalid get/put usage Aleksa Sarai <cyphar@cyphar.com> - 2015-08-23 15:20 +0200
      Re: [PATCH 2/2] cgroup: pids: fix invalid get/put usage Tejun Heo <tj@kernel.org> - 2015-08-24 21:10 +0200

csiph-web