memcg_stat_rss.sh 2.9 KB

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