public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org,
	richard@nod.at, "Frédéric Weisbecker" <fweisbec@gmail.com>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org
Subject: Re: [PATCH v10 4/4] cgroups: implement the PIDs subsystem
Date: Fri, 24 Apr 2015 11:26:13 -0400	[thread overview]
Message-ID: <20150424152613.GB24029@htj.duckdns.org> (raw)
In-Reply-To: <CAOviyagQTu_ARVURBmtHtXGMugMsgSyZ2Es3ix8mQASCNkuPyA@mail.gmail.com>

Hello, Aleksa.

On Sat, Apr 25, 2015 at 12:07:34AM +1000, Aleksa Sarai wrote:
> Would something like this suffice?
> 
> struct cgroup_subsys_state *task_get_css(struct task_struct *task, int
> subsys_id) {
>         bool have_ref = false;
>         struct cgroup_subsys_state *css;
> 
>         while(!have_ref) {
>                 rcu_read_lock();
>                 css = task_css(task, subsys_id);
>                 have_ref = !css_tryget(css);
>                 rcu_read_unlock();
>         }
> 
>         return css;
> }

I was thinking why this felt so familiar and realized that I have the
patch pending.

 http://lkml.kernel.org/g/1428350318-8215-8-git-send-email-tj@kernel.org

Please feel free to include it in the patch series.  I'll sort out the
merging later.

> Also, as a side note (in the same vein I guess), does a ref on a
> css_set give you an implicit ref on a css inside that css_set, or are
> those two orthogonal operations?

Yes, it does, but if you're gonna depend on that, please document that.

Thanks.

-- 
tejun

  reply	other threads:[~2015-04-24 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 14:07 [PATCH v10 4/4] cgroups: implement the PIDs subsystem Aleksa Sarai
2015-04-24 15:26 ` Tejun Heo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-19 12:22 [PATCH v10 0/4] cgroups: add pids subsystem Aleksa Sarai
     [not found] ` <1429446154-10660-1-git-send-email-cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org>
2015-04-19 12:22   ` [PATCH v10 4/4] cgroups: implement the PIDs subsystem Aleksa Sarai
     [not found]     ` <1429446154-10660-5-git-send-email-cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org>
2015-04-22 16:29       ` Tejun Heo
     [not found]         ` <20150422162954.GF10738-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-04-23  0:43           ` Aleksa Sarai
     [not found]             ` <CAOviyagHJhxD8E+CeEdy399ARPaNyyiSJSJjByK=5ALN5jxbJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-24 15:36               ` Tejun Heo
     [not found]                 ` <20150424153657.GC24029-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-05-13 17:04                   ` Aleksa Sarai
     [not found]                     ` <CAOviyah9yyXJG0eUeizpb5ZnzNUAKfxXGkXJw-5sNw7sQOAEuA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 17:29                       ` Tejun Heo
2015-05-13 17:44                         ` Aleksa Sarai
     [not found]                           ` <CAOviyaimfHD=Jg1+FEwyapwO=zdaL0bvq8YDA1Cnq90YbfGENQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 17:47                             ` Tejun Heo
     [not found]                               ` <20150513174707.GA11388-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-05-16  3:59                                 ` Aleksa Sarai
     [not found]                                   ` <CAOviyaiJnxmiRPEGFutEXiV-D5XwJUhwRJ1w8P3Yn2QLGO9bbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-18  1:24                                     ` Tejun Heo
2015-04-24 14:24           ` Aleksa Sarai

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=20150424152613.GB24029@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cyphar@cyphar.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    /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