linux-kselftest-next-6.1-rc1-2

This second Kselftest update for Linux 6.1-rc1 consists of fixes
 and improvements to memory-hotplug test and a minor spelling fix
 to ftrace test.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmNG4hgACgkQCwJExA0N
 QxwkPBAAyPd0ZUHlF7JjzdV2obHDGxbjMzi0x8Di8md4B24gE0PvGY79E7eM/uKd
 pBsop5cnvwGBZGuoBM0E/1J7UB/Lgedl2iYDUFXQe8JoPlOgvmBMbJCdZ3Zv8gxp
 sk5yIrLakgyp2WZng0QyQwZQY4nvq8Lf/f50T8/3+g8OBqF+xTo60DyEpsaDNHS4
 3SddH8/jJ6TkG/5lRoEOlfYFrhCDuxq1e8R0jts1vgnpdhpSD9JZPr26VNGVcygB
 dkp4icsQFWAaZjNO6+7scgp1yfxBFJ2Fh/gDdfWqEAYvZtvnnr2XhwlYK+O7JZRp
 DuglF4Lo/AN3betWuAz4rWyqAYoBZxrUTxrsIVyzb3FqpRAlR32YPFfMo6iWYYn4
 638E6cYvkNbbbhCEEgHJJiFZzUB/xbLR/Y8gD4Que/Y+Ck7+zuvQMzZWHQNJfsGx
 OhhfUcJlw/VzRpdZx1UToT++DqOqJLBL7DVMATbiXd2rDGKbnEw2pKkeuURXVged
 1nis9odge5yY42Q5I3doyPHO7rENOAP2wmlKvJqFDKZFoD23MsGv/m6gpg/HaS1Q
 T27L1hHFXPrAZ14MxGva1DTVTPU8D/ciHcqjCWWmnHp8M359JvjOsDL7PyMUcGlm
 bVSqcciy71utp1XaFfaF7kT1bwnNeGgGqs0EXcmj4xE8CyOtat8=
 =GXpd
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-next-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull more Kselftest updates from Shuah Khan:
 "This consists of fixes and improvements to memory-hotplug test and a
  minor spelling fix to ftrace test"

* tag 'linux-kselftest-next-6.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  docs: notifier-error-inject: Correct test's name
  selftests/memory-hotplug: Adjust log info for maintainability
  selftests/memory-hotplug: Restore memory before exit
  selftests/memory-hotplug: Add checking after online or offline
  selftests/ftrace: func_event_triggers: fix typo in user message
This commit is contained in:
Linus Torvalds 2022-10-12 14:59:13 -07:00
commit 661e00960f
3 changed files with 30 additions and 10 deletions

View File

@ -91,8 +91,8 @@ For more usage examples
There are tools/testing/selftests using the notifier error injection features There are tools/testing/selftests using the notifier error injection features
for CPU and memory notifiers. for CPU and memory notifiers.
* tools/testing/selftests/cpu-hotplug/on-off-test.sh * tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
* tools/testing/selftests/memory-hotplug/on-off-test.sh * tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
These scripts first do simple online and offline tests and then do fault These scripts first do simple online and offline tests and then do fault
injection tests if notifier error injection module is available. injection tests if notifier error injection module is available.

View File

@ -85,7 +85,7 @@ run_enable_disable() {
echo $check_disable > $EVENT_ENABLE echo $check_disable > $EVENT_ENABLE
done done
sleep $SLEEP_TIME sleep $SLEEP_TIME
echo " make sure it's still works" echo " make sure it still works"
test_event_enabled $check_enable_star test_event_enabled $check_enable_star
reset_ftrace_filter reset_ftrace_filter

View File

@ -134,6 +134,16 @@ offline_memory_expect_fail()
return 0 return 0
} }
online_all_offline_memory()
{
for memory in `hotpluggable_offline_memory`; do
if ! online_memory_expect_success $memory; then
echo "$FUNCNAME $memory: unexpected fail" >&2
retval=1
fi
done
}
error=-12 error=-12
priority=0 priority=0
# Run with default of ratio=2 for Kselftest run # Run with default of ratio=2 for Kselftest run
@ -197,8 +207,11 @@ echo -e "\t trying to offline $target out of $hotpluggable_num memory block(s):"
for memory in `hotpluggable_online_memory`; do for memory in `hotpluggable_online_memory`; do
if [ "$target" -gt 0 ]; then if [ "$target" -gt 0 ]; then
echo "online->offline memory$memory" echo "online->offline memory$memory"
if offline_memory_expect_success $memory; then if offline_memory_expect_success $memory &>/dev/null; then
target=$(($target - 1)) target=$(($target - 1))
echo "-> Success"
else
echo "-> Failure"
fi fi
fi fi
done done
@ -257,7 +270,7 @@ prerequisite_extra
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
for memory in `hotpluggable_online_memory`; do for memory in `hotpluggable_online_memory`; do
if [ $((RANDOM % 100)) -lt $ratio ]; then if [ $((RANDOM % 100)) -lt $ratio ]; then
offline_memory_expect_success $memory offline_memory_expect_success $memory &>/dev/null
fi fi
done done
@ -266,16 +279,16 @@ done
# #
echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
for memory in `hotpluggable_offline_memory`; do for memory in `hotpluggable_offline_memory`; do
online_memory_expect_fail $memory if ! online_memory_expect_fail $memory; then
retval=1
fi
done done
# #
# Online all hot-pluggable memory # Online all hot-pluggable memory
# #
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
for memory in `hotpluggable_offline_memory`; do online_all_offline_memory
online_memory_expect_success $memory
done
# #
# Test memory hot-remove error handling (online => offline) # Test memory hot-remove error handling (online => offline)
@ -283,11 +296,18 @@ done
echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
for memory in `hotpluggable_online_memory`; do for memory in `hotpluggable_online_memory`; do
if [ $((RANDOM % 100)) -lt $ratio ]; then if [ $((RANDOM % 100)) -lt $ratio ]; then
offline_memory_expect_fail $memory if ! offline_memory_expect_fail $memory; then
retval=1
fi
fi fi
done done
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
/sbin/modprobe -q -r memory-notifier-error-inject /sbin/modprobe -q -r memory-notifier-error-inject
#
# Restore memory before exit
#
online_all_offline_memory
exit $retval exit $retval