* Re: [LTP] [PATCH v2] mem/tunable: new testcase about overcommiting memory
[not found] <863d9faeb5d714aa6c06a7a33fd5f2649b8bdb3f.1329134279.git.zliu@redhat.com>
@ 2012-02-13 14:20 ` Caspar Zhang
2012-02-16 19:30 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Caspar Zhang @ 2012-02-13 14:20 UTC (permalink / raw)
To: ltp-list
On 02/13/2012 08:07 PM, Zhouping Liu wrote:
>
> There are two tunables overcommit_memory and overcommit_ratio under
> /proc/sys/vm/, which can control memory overcommitment.
>
> The overcommit_memory contains a flag that enables memory
> overcommitment, it has three values:
> - When this flag is 0, the kernel attempts to estimate the amount
> of free memory left when userspace requests more memory.
> - When this flag is 1, the kernel pretends there is always enough
> memory until it actually runs out.
> - When this flag is 2, the kernel uses a "never overcommit" policy
> that attempts to prevent any overcommit of memory.
>
> The overcommit_ratio tunable defines the amount by which the kernel
> overextends its memory resources in the event that overcommit_memory
> is set to the value of 2. The value in this file represents a
> percentage added to the amount of actual RAM in a system when
> considering whether to grant a particular memory request.
> The general formula for this tunable is:
> CommitLimit = SwapTotal + MemTotal * overcommit_ratio
> CommitLimit, SwapTotal and MemTotal can read from /proc/meminfo.
>
> The program is designed to test the two tunables:
>
> When overcommit_memory = 0, allocatable memory can't overextends
> the amount of free memory. I choose the three cases:
> a. less than free_total: free_total / 2, alloc should pass.
> b. greater than free_total: free_total * 2, alloc should fail.
> c. equal to sum_total: sum_tatal, alloc should fail
>
> When overcommit_memory = 1, it can alloc enough much memory, I
> choose the three cases:
> a. less than sum_total: sum_total / 2, alloc should pass
> b. equal to sum_total: sum_total, alloc should pass
> c. greater than sum_total: sum_total * 2, alloc should pass
> *note: sum_total = SwapTotal + MemTotal
>
> When overcommit_memory = 2, the total virtual address space on
> the system is limited to CommitLimit(Swap+RAM*overcommit_ratio)
> commit_left(allocatable memory) = CommitLimit - Committed_AS
> a. less than commit_left: commit_left / 2, alloc should pass
> b. greater than commit_left: commit_left * 2, alloc should fail
> c. overcommit limit: CommitLimit, alloc should fail
> *note: CommitLimit is the current overcommit limit.
> Committed_AS is the amount of memory that system has used.
> it couldn't choose 'equal to commit_left' as a case, because
> commit_left rely on Committed_AS, but the Committed_AS is not stable.
>
> References:
> - Documentation/sysctl/vm.txt
> - Documentation/vm/overcommit-accounting
>
> Signed-off-by: Zhouping Liu <zliu@redhat.com>
> ---
> hi, all
>
> v1 -> v2: used SAFE_STRTOL macro.
>
> please review the patch, any comments are welcome.
>
> runtest/mm | 7 +
> testcases/kernel/mem/tunable/Makefile | 43 ++++
> testcases/kernel/mem/tunable/overcommit_memory.c | 275 ++++++++++++++++++++++
> 3 files changed, 325 insertions(+), 0 deletions(-)
> create mode 100644 testcases/kernel/mem/tunable/Makefile
> create mode 100644 testcases/kernel/mem/tunable/overcommit_memory.c
>
Acked-by: Caspar Zhang <caspar@casparzhang.com>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH v2] mem/tunable: new testcase about overcommiting memory
2012-02-13 14:20 ` [LTP] [PATCH v2] mem/tunable: new testcase about overcommiting memory Caspar Zhang
@ 2012-02-16 19:30 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2012-02-16 19:30 UTC (permalink / raw)
To: Caspar Zhang; +Cc: ltp-list
Hi!
> Acked-by: Caspar Zhang <caspar@casparzhang.com>
>
This one as well.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-16 19:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <863d9faeb5d714aa6c06a7a33fd5f2649b8bdb3f.1329134279.git.zliu@redhat.com>
2012-02-13 14:20 ` [LTP] [PATCH v2] mem/tunable: new testcase about overcommiting memory Caspar Zhang
2012-02-16 19:30 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.