1#!/bin/sh 2 3################################################################################ 4## ## 5## Copyright (c) 2009 FUJITSU LIMITED ## 6## ## 7## This program is free software; you can redistribute it and#or modify ## 8## it under the terms of the GNU General Public License as published by ## 9## the Free Software Foundation; either version 2 of the License, or ## 10## (at your option) any later version. ## 11## ## 12## This program is distributed in the hope that it will be useful, but ## 13## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## 14## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## 15## for more details. ## 16## ## 17## You should have received a copy of the GNU General Public License ## 18## along with this program; if not, write to the Free Software Foundation, ## 19## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## 20## ## 21## Author: Li Zefan <lizf@cn.fujitsu.com> ## 22## Restructure for LTP: Shi Weihua <shiwh@cn.fujitsu.com> ## 23## Added memcg enable/disable functinality: Rishikesh K Rajak ## 24## <risrajak@linux.vnet.ibm.com ## 25## ## 26################################################################################ 27 28TCID="memcg_stat_rss" 29TST_TOTAL=10 30 31. memcg_lib.sh 32 33# Test the management and counting of memory 34testcase_1() 35{ 36 test_mem_stat "--mmap-anon" $PAGESIZES $PAGESIZES "rss" $PAGESIZES false 37} 38 39testcase_2() 40{ 41 test_mem_stat "--mmap-file" $PAGESIZE $PAGESIZE "rss" 0 false 42} 43 44testcase_3() 45{ 46 test_mem_stat "--shm -k 3" $PAGESIZE $PAGESIZE "rss" 0 false 47} 48 49testcase_4() 50{ 51 test_mem_stat "--mmap-anon --mmap-file --shm" \ 52 $PAGESIZES $((PAGESIZES*3)) "rss" $PAGESIZES false 53} 54 55testcase_5() 56{ 57 test_mem_stat "--mmap-lock1" $PAGESIZES $PAGESIZES "rss" $PAGESIZES false 58} 59 60testcase_6() 61{ 62 test_mem_stat "--mmap-anon" $PAGESIZES $PAGESIZES "rss" $PAGESIZES true 63} 64 65testcase_7() 66{ 67 test_mem_stat "--mmap-file" $PAGESIZE $PAGESIZE "rss" 0 true 68} 69 70testcase_8() 71{ 72 test_mem_stat "--shm -k 8" $PAGESIZE $PAGESIZE "rss" 0 true 73} 74 75testcase_9() 76{ 77 test_mem_stat "--mmap-anon --mmap-file --shm" \ 78 $PAGESIZES $((PAGESIZES*3)) "rss" $PAGESIZES true 79} 80 81testcase_10() 82{ 83 test_mem_stat "--mmap-lock1" $PAGESIZES $PAGESIZES "rss" $PAGESIZES true 84} 85 86shmmax_setup 87LOCAL_CLEANUP=shmmax_cleanup 88run_tests 89tst_exit 90