[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200117165918.GJ2677547@devbig004.ftw2.facebook.com>
Date: Fri, 17 Jan 2020 08:59:18 -0800
From: Tejun Heo <tj@...nel.org>
To: Michal Koutný <mkoutny@...e.com>
Cc: cgroups@...r.kernel.org, Johannes Weiner <hannes@...xchg.org>,
Li Zefan <lizefan@...wei.com>, alex.shi@...ux.alibaba.com,
guro@...com, kernel-team@...roid.com, linger.lee@...iatek.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-mediatek@...ts.infradead.org, matthias.bgg@...il.com,
shuah@...nel.org, tomcherry@...gle.com
Subject: Re: [PATCH 1/3] cgroup: Unify css_set task lists
On Fri, Jan 17, 2020 at 04:15:31PM +0100, Michal Koutný wrote:
> We track tasks of css_set in three different lists. The iterators
> unnecessarily process each list specially.
> Use an array of lists and simplify the iterator code. This is
> refactoring with no intended functional change.
>
> Signed-off-by: Michal Koutný <mkoutny@...e.com>
> ---
> include/linux/cgroup-defs.h | 15 ++++---
> include/linux/cgroup.h | 4 +-
> kernel/cgroup/cgroup.c | 81 +++++++++++++++++++------------------
> kernel/cgroup/debug.c | 16 ++++----
> 4 files changed, 60 insertions(+), 56 deletions(-)
So, I get the urge to move the lists into an array and thought about
doing that while adding the third list for sure. However, it does
make code paths which don't walk all lists wordier and the code path
is already tricky like hell. Given that there aren't that many places
which loop over the lists, if you really wanna clean it up, maybe add
an interator over the lists so that both parts of code can look lean?
Thanks.
--
tejun
Powered by blists - more mailing lists