From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 4/4] memcg_stress_test.sh: allocate less than CommitLimit bytes
Date: Wed, 18 May 2016 20:29:19 +0300 [thread overview]
Message-ID: <573CA66F.9000900@oracle.com> (raw)
In-Reply-To: <20160518143918.GB17880@rei.lan>
On 05/18/2016 05:39 PM, Cyril Hrubis wrote:
> Hi!
>> There is an idea. If we set memory.limit_in_bytes of a cgroup to a value
>> less than the amount of memory.usage_in_bytes, then activities of
>> processes of this cgroup will involve swapping.
>>
>> So what do you think about this scheme:
>>
>> mem = RAM * overcommit_ratio - Committed_AS
>> overcommit_memory = 1
>
> I do not understand why we choose exactly this number.
>
> RAM * overcommit_ratio is something as half of RAM on usuall system,
> right? Then we substract Committed_AS, which is amount of memory system
> would have needed to back up all allocations so we may easily end up
> with a negative number if more than half of the RAM was requested by
> running programs.
>
> On my notebook I have 6.6Gb Commited_AS and RAM * overcommit_ratio = 2Gb
> the CommitLimit is 10Gb since I have 4GB RAM and 8GB Swap.
>
I run LTP mostly on systems with no load, and somehow missed this
obvious fact, that Committed_AS could be large. Sorry if I misguided you.
> I guess that when we decide to create the pressure inside of the memory
> cgroup, instead of stressing the whole system, we may as well choose
> small enough amount of memory, something as (RAM - 250Mb)/10 and be done
> with it.
Yes, this should work as well.
I don't know how we could stress the whole system without the risk of
hitting an OOM. One idea which comes to my mind is about using a
top-level control group with a significant amount of memory assigned to
it (like mem_free / 2).
Could you, please, have a look at the attachment? I was playing with
this patch today and was able to stress my system without OOM.
However, this scheme may result in a very intensive swapping if mem_free
is large (given that there is enough swap).
>
> [CCing Michal Hocko]
>
> Michal is there a way to figure out how much memory should be allocated
> and faulted on a system in order to cause some amount of pages to be
> swapped back and forth?
>
> What this testcase does it to create a process(es) that allocate memory
> and read/write it concurently to stress the system a bit but the
> estimate on how much memory it should use is wrong and it causes OOM
> when the amount of swap is much less than amount of RAM.
>
> The original testcase[1] drops caches then runs child(s) to allocate
> (in sum) MemFree + SwapFree/2 memory. Each child runs in its own memory
> cgroup but the amount of memory was choosen so that the whole system
> would be under memory pressure. Does such test even make sense to you?
>
> [1]:
> https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-draft.patch
Type: text/x-patch
Size: 3646 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160518/8bcafce2/attachment-0001.bin>
next prev parent reply other threads:[~2016-05-18 17:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 15:23 [LTP] [PATCH 1/4] memcg_process_stress: cleanup Stanislav Kholmanskikh
2016-04-22 15:23 ` [LTP] [PATCH 2/4] memcg_process_stress: allocate memory not in the signal handler Stanislav Kholmanskikh
2016-04-22 15:23 ` [LTP] [PATCH 3/4] memcg_stress_test.sh: rewrite Stanislav Kholmanskikh
2016-04-22 15:23 ` [LTP] [RFC PATCH 4/4] memcg_stress_test.sh: allocate less than CommitLimit bytes Stanislav Kholmanskikh
2016-05-12 13:42 ` Cyril Hrubis
2016-05-17 12:52 ` Stanislav Kholmanskikh
2016-05-17 13:02 ` Stanislav Kholmanskikh
2016-05-18 14:39 ` Cyril Hrubis
2016-05-18 17:29 ` Stanislav Kholmanskikh [this message]
2016-05-19 13:38 ` Cyril Hrubis
2016-05-23 11:12 ` Stanislav Kholmanskikh
2016-05-24 16:46 ` Cyril Hrubis
2016-05-19 9:17 ` Michal Hocko
2016-05-19 12:56 ` Cyril Hrubis
2016-05-19 19:21 ` Michal Hocko
2016-05-24 16:21 ` Cyril Hrubis
2016-05-11 15:01 ` [LTP] [PATCH 3/4] memcg_stress_test.sh: rewrite Cyril Hrubis
2016-05-11 14:39 ` [LTP] [PATCH 2/4] memcg_process_stress: allocate memory not in the signal handler Cyril Hrubis
2016-05-12 11:09 ` Stanislav Kholmanskikh
2016-05-12 11:26 ` Cyril Hrubis
2016-05-11 14:16 ` [LTP] [PATCH 1/4] memcg_process_stress: cleanup Cyril Hrubis
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=573CA66F.9000900@oracle.com \
--to=stanislav.kholmanskikh@oracle.com \
--cc=ltp@lists.linux.it \
/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