public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Caspar Zhang <caspar@casparzhang.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] mem/tunable: new testcase about max_map_count tunable
Date: Mon, 13 Feb 2012 22:20:23 +0800	[thread overview]
Message-ID: <4F391C27.2040905@casparzhang.com> (raw)
In-Reply-To: <1cf48238f2cc23c9e93310ca22617296cb8a8f51.1329113234.git.zliu@redhat.com>

On 02/13/2012 02:18 PM, Zhouping Liu wrote:
> 
> The program is designed to test max_map_count tunable file
> 
> The kernel Documentation say that:
> /proc/sys/vm/max_map_count contains the maximum number of memory map
> areas a process may have. Memory map areas are used as a side-effect
> of calling malloc, directly by mmap and mprotect, and also when
> loading shared libraries.
> 
> Each process has his own maps file: /proc/[pid]/maps, and each line
> indicates a map entry, so it can caculate the amount of maps by reading
> the file lines' number to check the tunable performance.
> 
> The program trys to invoke mmap() endless until triggering MAP_FAILED,
> then read the process's maps file /proc/[pid]/maps, save the line number
> to map_count variable, and compare it with /proc/sys/vm/max_map_count,
> map_count should less than max_map_count.
> Note: There are two special vmas VDSO and VSYSCALL, which are allocated
> via install_special_mapping(), install_specail_mapping() allows the VMAs
> to be allocated and inserted without checking the sysctl_map_map_count,
> and each /proc/<pid>/maps has both at the end:
> ...
> ...
> 7fff7b9ff000-7fff7ba00000 r-xp 00000000 00:00 0           [vdso]
> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0   [vsyscall]
> 
> so during comparing with map_count and /proc/sys/vm/max_map_count,
> we should except the two special vmas from map_count:
> map_count -= 2;
> 
> While most applications need less than a thousand maps, and the tunable
> default value is 65530.
> When the value is too large or too little, the system would hang, so I
> choose four special value to test, which can coverage most situation:
> a) Default value / 100
> b) Default value / 10
> c) Default value
> d) Default value * 10
> 
> Signed-off-by: Zhouping Liu <zliu@redhat.com>
> ---
>  runtest/mm                                   |    2 +
>  testcases/kernel/mem/tunable/max_map_count.c |  197 ++++++++++++++++++++++++++
>  2 files changed, 199 insertions(+), 0 deletions(-)
>  create mode 100644 testcases/kernel/mem/tunable/max_map_count.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

       reply	other threads:[~2012-02-13 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <541a69a479af6ba8c2ce0af8ab890851dfed4caa.1329113234.git.zliu@redhat.com>
     [not found] ` <1cf48238f2cc23c9e93310ca22617296cb8a8f51.1329113234.git.zliu@redhat.com>
2012-02-13 14:20   ` Caspar Zhang [this message]
2012-02-16 19:30     ` [LTP] [PATCH] mem/tunable: new testcase about max_map_count tunable 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=4F391C27.2040905@casparzhang.com \
    --to=caspar@casparzhang.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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