Re: [PATCH v2] memcg: first step towards hierarchical controller

Ben Hutchings
2012-09-03T16:41:48Z

On Mon, Sep 03, 2012 at 07:46:51PM +0400, Glauber Costa wrote:
> Here is a new attempt to lay down a path that will allow us to deprecate
> the non-hierarchical mode of operation from memcg. Unlike what I posted
> before, I am making this behavior conditional on a Kconfig option.
> Vanilla users will see no change in behavior unless they don't
> explicitly set this option to on.

There are too many negatives in this sentence - it is not only
unclear, but appears to be incorrect. I think you should delete
'don't'.

[...]
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -726,6 +726,24 @@ config MEMCG_SWAP
> if boot option "swapaccount=0" is set, swap will not be accounted.
> Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
> size is 4096bytes, 512k per 1Gbytes of swap.
> +
> +config MEMCG_HIERARCHY_DEFAULT
> + bool "Hierarchical memcg"
> + depends on MEMCG
> + default n
> + help
> + The memory controller has two modes of accounting: hierarchical and
> + flat. Hierarchical accounting will charge pages all the way towards a
> + group's parent while flat hierarchy will threat all groups as children

typo: 'threat' should be 'treat'

> + of the root memcg, regardless of their positioning in the tree.
> +
> + Use of flat hierarchies is highly discouraged, but has been the
> + default for performance reasons for quite some time. Setting this flag
> + to on will make hierarchical accounting the default. It is still
> + possible to set it back to flat by writing 0 to the file
> + memory.use_hierarchy, albeit discouraged. Distributors are encouraged
> + to set this option.
[...]

I don't think that 'default n' is effective encouragement!

Ben.

--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus