linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Add the max_usage member on the res_counter
Date: Wed, 12 Mar 2008 12:04:36 +0300	[thread overview]
Message-ID: <47D79CA4.5090102@openvz.org> (raw)
In-Reply-To: <20080311214034.d2cae354.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Tue, 11 Mar 2008 17:55:46 +0300 Pavel Emelyanov <xemul@openvz.org> wrote:
> 
>> This field is the maximal value of the usage one since the counter
>> creation (or since the latest reset).
>>
>> To reset this to the usage value simply write anything to the
>> appropriate cgroup file.
> 
> What is the justification for making this change?  Why do we need it? 

The max_usage value is useful when gathering a statistical information
about the particular group, as it shows the actual memory requirements 
for a particular group, not just some usage snapshot.

E.g. this value can be used to quickly tune the group. OpenVZ users often
set the limits to maximal values and either load the container with a common
patterns or leave one for a while. After this the max_usage value shows the 
amount of memory the container would require during its common activity. 
Setting the limit a bit above this value gives a pretty good configuration, 
that works in the most cases.

But, please see my second comment.

> Please provide this information for all patches where it is not obvious.
> 
>>  	{
>> +		.name = "max_usage_in_bytes",
>> +		.private = RES_MAX_USAGE,
>> +		.write = mem_cgroup_max_reset,
>> +		.read_u64 = mem_cgroup_read,
>> +	},
> 
> Documentation/controllers/memory.txt needs updating.
> 

I'm preparing the Documentation/controllers/resource_counter.txt file
that will describe this abstraction. Since this one can be used for
many other resources (swap, kernel memory, networking, etc) this will
also eliminate all the possible future duplications in the appropriate
docs.

The above explanation of the max_usage attribute will be included in
this doc. Should it still be included in the previous patch's comment or
in the patch _as_a_ comment?

      reply	other threads:[~2008-03-12  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 14:55 [PATCH] Add the max_usage member on the res_counter Pavel Emelyanov
2008-03-12  4:40 ` Andrew Morton
2008-03-12  9:04   ` Pavel Emelyanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47D79CA4.5090102@openvz.org \
    --to=xemul@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).