lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 5 Aug 2013 08:44:17 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	lizefan@...wei.com, containers@...ts.linux-foundation.org,
	cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Michal Hocko <mhocko@...e.cz>,
	Balbir Singh <bsingharora@...il.com>,
	Aristeu Rozanski <aris@...hat.com>,
	Matt Helsley <matthltc@...ibm.com>,
	Daniel Wagner <daniel.wagner@...-carit.de>,
	Jens Axboe <axboe@...nel.dk>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 08/23] cgroup: pass around cgroup_subsys_state instead of
 cgroup in subsystem methods

On Thu, Aug 01, 2013 at 05:49:46PM -0400, Tejun Heo wrote:
> cgroup is currently in the process of transitioning to using struct
> cgroup_subsys_state * as the primary handle instead of struct cgroup *
> in subsystem implementations for the following reasons.
> 
> * With unified hierarchy, subsystems will be dynamically bound and
>   unbound from cgroups and thus css's (cgroup_subsys_state) may be
>   created and destroyed dynamically over the lifetime of a cgroup,
>   which is different from the current state where all css's are
>   allocated and destroyed together with the associated cgroup.  This
>   in turn means that cgroup_css() should be synchronized and may
>   return NULL, making it more cumbersome to use.
> 
> * Differing levels of per-subsystem granularity in the unified
>   hierarchy means that the task and descendant iterators should behave
>   differently depending on the specific subsystem the iteration is
>   being performed for.
> 
> * In majority of the cases, subsystems only care about its part in the
>   cgroup hierarchy - ie. the hierarchy of css's.  Subsystem methods
>   often obtain the matching css pointer from the cgroup and don't
>   bother with the cgroup pointer itself.  Passing around css fits
>   much better.
> 
> This patch converts all cgroup_subsys methods to take @css instead of
> @cgroup.  The conversions are mostly straight-forward.  A few
> noteworthy changes are
> 
> * ->css_alloc() now takes css of the parent cgroup rather than the
>   pointer to the new cgroup as the css for the new cgroup doesn't
>   exist yet.  Knowing the parent css is enough for all the existing
>   subsystems.
> 
> * In kernel/cgroup.c::offline_css(), unnecessary open coded css
>   dereference is replaced with local variable access.
> 
> This patch shouldn't cause any behavior differences.
> 
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Cc: Li Zefan <lizefan@...wei.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michal Hocko <mhocko@...e.cz>
> Cc: Balbir Singh <bsingharora@...il.com>
> Cc: Aristeu Rozanski <aris@...hat.com>
> Cc: Matt Helsley <matthltc@...ibm.com>
> Cc: Daniel Wagner <daniel.wagner@...-carit.de>
> Cc: Vivek Goyal <vgoyal@...hat.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> ---
>  block/blk-cgroup.c        | 25 +++++++++++-----------

blk-cgroup changes look good to me.

Acked-by: Vivek Goyal <vgoyal@...hat.com>

Vivek
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ