do_ctx 593 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # Make sure we can find: ./cmd, df, and netstat
  3. PATH=.:$PATH:/etc:/usr/etc:/sbin:/usr/sbin
  4. export PATH
  5. if [ X$MB = X ]
  6. then MB=8
  7. fi
  8. AVAILKB=`expr $MB \* 1024`
  9. # Figure out how big we can go for stuff that wants to use
  10. # all and half of memory.
  11. HALF="512 1k 2k 4k 8k 16k 32k 64k 128k 256k 512k 1m"
  12. ALL="$HALF 2m"
  13. i=4
  14. while [ $i -le $MB ]
  15. do
  16. ALL="$ALL ${i}m"
  17. h=`expr $i / 2`
  18. HALF="$HALF ${h}m"
  19. i=`expr $i \* 2`
  20. done
  21. msleep 250
  22. if [ "X$CTX" = X ]
  23. then CTX="0 4 8 16 32 64"
  24. fi
  25. if [ "X$N" = X ]
  26. then N="2 4 8 16 24 32 64 96"
  27. fi
  28. for size in $CTX
  29. do lat_ctx -s $size $N
  30. done
  31. exit 0