From patchwork Wed Oct 12 17:32:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 614699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5862DC433FE for ; Wed, 12 Oct 2022 17:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbiJLRce (ORCPT ); Wed, 12 Oct 2022 13:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiJLRcc (ORCPT ); Wed, 12 Oct 2022 13:32:32 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC28573C15 for ; Wed, 12 Oct 2022 10:32:30 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id p16so8275257iod.6 for ; Wed, 12 Oct 2022 10:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:cc:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=+kQEr10CffGYkP9q7mTic/LVRYEHz5k8rQoBjrooJG0=; b=AXq22O9iap2zuRdKqLSGBpDoF6E3RuF6Yy/w/9C5nvyvhmbvLlqniXj0iC+vssKjSx B9s4768GXsAi2i8PgQCrcmz9ju7RFQofeR6Y34WpfeygAGY3nfs499L7ExvIE4cpOHLG ul+I3HcLNpg7RfbZ+PcjIR3UjXRXdNjMlc0NM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:cc:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+kQEr10CffGYkP9q7mTic/LVRYEHz5k8rQoBjrooJG0=; b=2XRTFAnIkANWpO+Wz4Z9vXvDp7CCBwgZiqC2lXw78lCBc5PrqbZ8zSeZL6/moMWuxZ S+4pzc5ItqyexW3IJXmcmny3jbhNuCdYNmsLcHy6goaX4U9V2ApX3/74rUrnnT3FjuSU gxGCrPgoBqk8wS3eotk/yJQCQHQdWFCvZX1KZoKnqYUf06Z1Gq0BPw5IxbUIZ9OzDoNM BnbhgiUyrL6kh7KQRk/BxPwsTmiO+rT/wASFvcJj/oKqlAeTY20UE5PY6O75RKCMFZNt OrkaHl1B2Zkd6zW0AnNLmxrwxWOmwlZuX6770Rj0O1V51IBJO2o84njc3qCoCMykSZ24 fH9Q== X-Gm-Message-State: ACrzQf1O+ywW3QU07URBhGIsAv68joKbdpMtOhyq/+F1bTG8qQgdXO21 Egv4PtLzbkNVLDetKyTI1E+zUA== X-Google-Smtp-Source: AMsMyM5ga/fIEIvc2NKHh9AOW5wqunRfgw5h3/xVIUAmxbmOgGwtx70x1pP/NAAzl/9EGjH5QS7wCA== X-Received: by 2002:a6b:b887:0:b0:6bb:fc82:d94b with SMTP id i129-20020a6bb887000000b006bbfc82d94bmr9259243iof.205.1665595950219; Wed, 12 Oct 2022 10:32:30 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id l8-20020a056e020e4800b002fa0ca86f76sm5946097ilk.15.2022.10.12.10.32.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Oct 2022 10:32:29 -0700 (PDT) Message-ID: Date: Wed, 12 Oct 2022 11:32:29 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: Linus Torvalds From: Shuah Khan Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Kselftest second update for Linux 6.1-rc1 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Hi Linus, Please pull the following second Kselftest update for Linux 6.1-rc1. 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. diff for this pull request is attached thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 83e14a57d59f22a89ad7d59752f5b69189299531: docs:kselftest: fix kselftest_module.h path of example module (2022-10-05 11:05:18 -0600) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-next-6.1-rc1-2 for you to fetch changes up to 6a24247132db8122600dc5523e3a62fa8fd28367: docs: notifier-error-inject: Correct test's name (2022-10-07 10:32:16 -0600) ---------------------------------------------------------------- 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. ---------------------------------------------------------------- Randy Dunlap (1): selftests/ftrace: func_event_triggers: fix typo in user message Zhao Gongyi (4): selftests/memory-hotplug: Add checking after online or offline selftests/memory-hotplug: Restore memory before exit selftests/memory-hotplug: Adjust log info for maintainability docs: notifier-error-inject: Correct test's name .../fault-injection/notifier-error-inject.rst | 4 +-- .../ftrace/test.d/ftrace/func_event_triggers.tc | 2 +- .../selftests/memory-hotplug/mem-on-off-test.sh | 34 +++++++++++++++++----- 3 files changed, 30 insertions(+), 10 deletions(-) ---------------------------------------------------------------- diff --git a/Documentation/fault-injection/notifier-error-inject.rst b/Documentation/fault-injection/notifier-error-inject.rst index 1668b6e48d3a..fdf2dc433ead 100644 --- a/Documentation/fault-injection/notifier-error-inject.rst +++ b/Documentation/fault-injection/notifier-error-inject.rst @@ -91,8 +91,8 @@ For more usage examples There are tools/testing/selftests using the notifier error injection features for CPU and memory notifiers. - * tools/testing/selftests/cpu-hotplug/on-off-test.sh - * tools/testing/selftests/memory-hotplug/on-off-test.sh + * tools/testing/selftests/cpu-hotplug/cpu-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 injection tests if notifier error injection module is available. diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc index 3145b0f1835c..8d26d5505808 100644 --- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc @@ -85,7 +85,7 @@ run_enable_disable() { echo $check_disable > $EVENT_ENABLE done sleep $SLEEP_TIME - echo " make sure it's still works" + echo " make sure it still works" test_event_enabled $check_enable_star reset_ftrace_filter diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh index 46a97f318f58..74ee5067a8ce 100755 --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh @@ -134,6 +134,16 @@ offline_memory_expect_fail() 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 priority=0 # 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 if [ "$target" -gt 0 ]; then echo "online->offline memory$memory" - if offline_memory_expect_success $memory; then + if offline_memory_expect_success $memory &>/dev/null; then target=$(($target - 1)) + echo "-> Success" + else + echo "-> Failure" fi fi done @@ -257,7 +270,7 @@ prerequisite_extra echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error for memory in `hotpluggable_online_memory`; do if [ $((RANDOM % 100)) -lt $ratio ]; then - offline_memory_expect_success $memory + offline_memory_expect_success $memory &>/dev/null fi done @@ -266,16 +279,16 @@ done # echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error for memory in `hotpluggable_offline_memory`; do - online_memory_expect_fail $memory + if ! online_memory_expect_fail $memory; then + retval=1 + fi done # # Online all hot-pluggable memory # echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error -for memory in `hotpluggable_offline_memory`; do - online_memory_expect_success $memory -done +online_all_offline_memory # # Test memory hot-remove error handling (online => offline) @@ -283,11 +296,18 @@ done echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error for memory in `hotpluggable_online_memory`; do if [ $((RANDOM % 100)) -lt $ratio ]; then - offline_memory_expect_fail $memory + if ! offline_memory_expect_fail $memory; then + retval=1 + fi fi done echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error /sbin/modprobe -q -r memory-notifier-error-inject +# +# Restore memory before exit +# +online_all_offline_memory + exit $retval