[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150424152613.GB24029@htj.duckdns.org>
Date: Fri, 24 Apr 2015 11:26:13 -0400
From: Tejun Heo <tj@...nel.org>
To: Aleksa Sarai <cyphar@...har.com>
Cc: lizefan@...wei.com, mingo@...hat.com, peterz@...radead.org,
richard@....at,
Frédéric Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v10 4/4] cgroups: implement the PIDs subsystem
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists