initlitmushist.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0+
  3. #
  4. # Runs the C-language litmus tests matching the specified criteria.
  5. # Generates the output for each .litmus file into a corresponding
  6. # .litmus.out file, and does not judge the result.
  7. #
  8. # sh initlitmushist.sh
  9. #
  10. # Run from the Linux kernel tools/memory-model directory.
  11. # See scripts/parseargs.sh for list of arguments.
  12. #
  13. # This script can consume significant wallclock time and CPU, especially as
  14. # the value of --procs rises. On a four-core (eight hardware threads)
  15. # 2.5GHz x86 with a one-minute per-run timeout:
  16. #
  17. # --procs wallclock CPU timeouts tests
  18. # 1 0m11.241s 0m1.086s 0 19
  19. # 2 1m12.598s 2m8.459s 2 393
  20. # 3 1m30.007s 6m2.479s 4 2291
  21. # 4 3m26.042s 18m5.139s 9 3217
  22. # 5 4m26.661s 23m54.128s 13 3784
  23. # 6 4m41.900s 26m4.721s 13 4352
  24. # 7 5m51.463s 35m50.868s 13 4626
  25. # 8 10m5.235s 68m43.672s 34 5117
  26. # 9 15m57.80s 105m58.101s 69 5156
  27. # 10 16m14.13s 103m35.009s 69 5165
  28. # 20 27m48.55s 198m3.286s 156 5269
  29. #
  30. # Increasing the timeout on the 20-process run to five minutes increases
  31. # the runtime to about 90 minutes with the CPU time rising to about
  32. # 10 hours. On the other hand, it decreases the number of timeouts to 101.
  33. #
  34. # Note that there are historical tests for which herd7 will fail
  35. # completely, for example, litmus/manual/atomic/C-unlock-wait-00.litmus
  36. # contains a call to spin_unlock_wait(), which no longer exists in either
  37. # the kernel or LKMM.
  38. . scripts/parseargs.sh
  39. T=/tmp/initlitmushist.sh.$$
  40. trap 'rm -rf $T' 0
  41. mkdir $T
  42. if test -d litmus
  43. then
  44. :
  45. else
  46. git clone https://github.com/paulmckrcu/litmus
  47. ( cd litmus; git checkout origin/master )
  48. fi
  49. # Create any new directories that have appeared in the github litmus
  50. # repo since the last run.
  51. if test "$LKMM_DESTDIR" != "."
  52. then
  53. find litmus -type d -print |
  54. ( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh )
  55. fi
  56. # Create a list of the C-language litmus tests with no more than the
  57. # specified number of processes (per the --procs argument).
  58. find litmus -name '*.litmus' -exec grep -l -m 1 "^C " {} \; > $T/list-C
  59. xargs < $T/list-C -r grep -L "^P${LKMM_PROCS}" > $T/list-C-short
  60. scripts/runlitmushist.sh < $T/list-C-short
  61. exit 0