[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160621185740.GR3262@mtj.duckdns.org>
Date: Tue, 21 Jun 2016 14:57:40 -0400
From: Tejun Heo <tj@...nel.org>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Li Zefan <lizefan@...wei.com>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH cgroup/for-4.8] cgroup: allow NULL return from
ss->css_alloc()
Hello,
On Tue, Jun 21, 2016 at 02:14:04PM -0400, Johannes Weiner wrote:
> Would it be better to remove the error code instead and have everybody
> return NULL? AFAICS, everybody is returning either the object or the
> -ENOMEM error code right now.
>
> What error condition is there for an allocation function?
I already changed cgroup core to interpret NULL return as -ENOMEM.
Maybe we can drop ERR_PTR handling altogether in the future but I'm
not sure. e.g. memcg's id allocation and -ENOSPC check could be in
css_alloc. The thing is css_online is only necessary if there are
requirements around css id or iteration, so css_alloc can easily be
the only alloc / init point and thus should be able to indicate
different failure conditions.
Thanks.
--
tejun
Powered by blists - more mailing lists