Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.82 KB | None | 0 0
  1. stress-ng --class memory?
  2. class 'memory' stressors: atomic bsearch context full heapsort hsearch
  3. lockbus lsearch malloc matrix membarrier memcpy memfd memrate memthrash
  4. mergesort mincore null numa oom-pipe pipe qsort radixsort remap
  5. resources rmap stack stackmmap str stream tlb-shootdown tmpfs tsearch
  6. vm vm-rw wcs zero zlib
  7.  
  8. stress-ng --class vm?
  9. class 'vm' stressors: bigheap brk madvise malloc mlock mmap mmapfork mmapmany
  10. mremap msync shm shm-sysv stack stackmmap tmpfs userfaultfd vm vm-rw
  11. vm-splice
  12.  
  13. -m N, --vm N
  14. start N workers continuously calling mmap(2)/munmap(2) and writ‐
  15. ing to the allocated memory. Note that this can cause systems to
  16. trip the kernel OOM killer on Linux systems if not enough physi‐
  17. cal memory and swap is not available.
  18.  
  19. --vm-bytes N
  20. mmap N bytes per vm worker, the default is 256MB. One can spec‐
  21. ify the size as % of total available memory or in units of
  22. Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g.
  23.  
  24. --vm-ops N
  25. stop vm workers after N bogo operations.
  26.  
  27. --vm-hang N
  28. sleep N seconds before unmapping memory, the default is zero
  29. seconds. Specifying 0 will do an infinite wait.
  30.  
  31. --vm-keep
  32. do not continually unmap and map memory, just keep on re-writing
  33. to it.
  34.  
  35. --vm-locked
  36. Lock the pages of the mapped region into memory using mmap
  37. MAP_LOCKED (since Linux 2.5.37). This is similar to locking
  38. memory as described in mlock(2).
  39.  
  40. --vm-madvise advice
  41. Specify the madvise 'advice' option used on the memory mapped
  42. regions used in the vm stressor. Non-linux systems will only
  43. have the 'normal' madvise advice, linux systems support 'dont‐
  44. need', 'hugepage', 'mergeable' , 'nohugepage', 'normal', 'ran‐
  45. dom', 'sequential', 'unmergeable' and 'willneed' advice. If this
  46. option is not used then the default is to pick random madvise
  47. advice for each mmap call. See madvise(2) for more details.
  48.  
  49. --vm-method m
  50. specify a vm stress method. By default, all the stress methods
  51. are exercised sequentially, however one can specify just one
  52. method to be used if required. Each of the vm workers have 3
  53. phases:
  54.  
  55. 1. Initialised. The anonymously memory mapped region is set to a
  56. known pattern.
  57.  
  58. 2. Exercised. Memory is modified in a known predictable way.
  59. Some vm workers alter memory sequentially, some use small or
  60. large strides to step along memory.
  61.  
  62. 3. Checked. The modified memory is checked to see if it matches
  63. the expected result.
  64.  
  65. The vm methods containing 'prime' in their name have a stride of
  66. the largest prime less than 2^64, allowing to them to thoroughly
  67. step through memory and touch all locations just once while also
  68. doing without touching memory cells next to each other. This
  69. strategy exercises the cache and page non-locality.
  70.  
  71. Since the memory being exercised is virtually mapped then there
  72. is no guarantee of touching page addresses in any particular
  73. physical order. These workers should not be used to test that
  74. all the system's memory is working correctly either, use tools
  75. such as memtest86 instead.
  76.  
  77. The vm stress methods are intended to exercise memory in ways to
  78. possibly find memory issues and to try to force thermal errors.
  79.  
  80. Available vm stress methods are described as follows:
  81.  
  82. Method Description
  83. all iterate over all the vm stress methods
  84. as listed below.
  85. flip sequentially work through memory 8
  86. times, each time just one bit in memory
  87. flipped (inverted). This will effec‐
  88. tively invert each byte in 8 passes.
  89. galpat-0 galloping pattern zeros. This sets all
  90. bits to 0 and flips just 1 in 4096 bits
  91. to 1. It then checks to see if the 1s
  92. are pulled down to 0 by their neighbours
  93. or of the neighbours have been pulled up
  94. to 1.
  95. galpat-1 galloping pattern ones. This sets all
  96. bits to 1 and flips just 1 in 4096 bits
  97. to 0. It then checks to see if the 0s
  98. are pulled up to 1 by their neighbours
  99. or of the neighbours have been pulled
  100. down to 0.
  101. gray fill the memory with sequential gray
  102. codes (these only change 1 bit at a time
  103. between adjacent bytes) and then check
  104. if they are set correctly.
  105. incdec work sequentially through memory twice,
  106. the first pass increments each byte by a
  107. specific value and the second pass
  108. decrements each byte back to the origi‐
  109. nal start value. The increment/decrement
  110. value changes on each invocation of the
  111. stressor.
  112. inc-nybble initialise memory to a set value (that
  113. changes on each invocation of the stres‐
  114. sor) and then sequentially work through
  115. each byte incrementing the bottom 4 bits
  116. by 1 and the top 4 bits by 15.
  117. rand-set sequentially work through memory in 64
  118. bit chunks setting bytes in the chunk to
  119. the same 8 bit random value. The random
  120. value changes on each chunk. Check that
  121. the values have not changed.
  122. rand-sum sequentially set all memory to random
  123. values and then summate the number of
  124. bits that have changed from the original
  125. set values.
  126. read64 sequentially read memory using 32 x 64
  127. bit reads per bogo loop. Each loop
  128. equates to one bogo operation. This
  129. exercises raw memory reads.
  130. ror fill memory with a random pattern and
  131. then sequentially rotate 64 bits of mem‐
  132. ory right by one bit, then check the
  133. final load/rotate/stored values.
  134. swap fill memory in 64 byte chunks with ran‐
  135. dom patterns. Then swap each 64 chunk
  136. with a randomly chosen chunk. Finally,
  137. reverse the swap to put the chunks back
  138. to their original place and check if the
  139. data is correct. This exercises adjacent
  140. and random memory load/stores.
  141. move-inv sequentially fill memory 64 bits of mem‐
  142. ory at a time with random values, and
  143. then check if the memory is set cor‐
  144. rectly. Next, sequentially invert each
  145. 64 bit pattern and again check if the
  146. memory is set as expected.
  147. modulo-x fill memory over 23 iterations. Each
  148. iteration starts one byte further along
  149. from the start of the memory and steps
  150. along in 23 byte strides. In each
  151. stride, the first byte is set to a ran‐
  152. dom pattern and all other bytes are set
  153. to the inverse. Then it checks see if
  154. the first byte contains the expected
  155. random pattern. This exercises cache
  156. store/reads as well as seeing if neigh‐
  157. bouring cells influence each other.
  158.  
  159. prime-0 iterate 8 times by stepping through mem‐
  160. ory in very large prime strides clearing
  161. just on bit at a time in every byte.
  162. Then check to see if all bits are set to
  163. zero.
  164. prime-1 iterate 8 times by stepping through mem‐
  165. ory in very large prime strides setting
  166. just on bit at a time in every byte.
  167. Then check to see if all bits are set to
  168. one.
  169. prime-gray-0 first step through memory in very large
  170. prime strides clearing just on bit
  171. (based on a gray code) in every byte.
  172. Next, repeat this but clear the other 7
  173. bits. Then check to see if all bits are
  174. set to zero.
  175. prime-gray-1 first step through memory in very large
  176. prime strides setting just on bit (based
  177. on a gray code) in every byte. Next,
  178. repeat this but set the other 7 bits.
  179. Then check to see if all bits are set to
  180. one.
  181. rowhammer try to force memory corruption using the
  182. rowhammer memory stressor. This fetches
  183. two 32 bit integers from memory and
  184. forces a cache flush on the two
  185. addresses multiple times. This has been
  186. known to force bit flipping on some
  187. hardware, especially with lower fre‐
  188. quency memory refresh cycles.
  189. walk-0d for each byte in memory, walk through
  190. each data line setting them to low (and
  191. the others are set high) and check that
  192. the written value is as expected. This
  193. checks if any data lines are stuck.
  194. walk-1d for each byte in memory, walk through
  195. each data line setting them to high (and
  196. the others are set low) and check that
  197. the written value is as expected. This
  198. checks if any data lines are stuck.
  199. walk-0a in the given memory mapping, work
  200. through a range of specially chosen
  201. addresses working through address lines
  202. to see if any address lines are stuck
  203. low. This works best with physical mem‐
  204. ory addressing, however, exercising
  205. these virtual addresses has some value
  206. too.
  207. walk-1a in the given memory mapping, work
  208. through a range of specially chosen
  209. addresses working through address lines
  210. to see if any address lines are stuck
  211. high. This works best with physical mem‐
  212. ory addressing, however, exercising
  213. these virtual addresses has some value
  214. too.
  215. write64 sequentially write memory using 32 x 64
  216. bit writes per bogo loop. Each loop
  217. equates to one bogo operation. This
  218. exercises raw memory writes. Note that
  219. memory writes are not checked at the end
  220. of each test iteration.
  221. zero-one set all memory bits to zero and then
  222. check if any bits are not zero. Next,
  223. set all the memory bits to one and check
  224. if any bits are not one.
  225.  
  226. --vm-populate
  227. populate (prefault) page tables for the memory mappings; this
  228. can stress swapping. Only available on systems that support
  229. MAP_POPULATE (since Linux 2.5.46).
  230.  
  231. stress-ng --vm 1 --vm-bytes 75% --vm-method all --verify -t 10m -v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement