Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp71625rwe; Wed, 31 Aug 2022 16:40:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yuEjaev0jdNEcqFNUVQXxX7446x95VnOw0MIHBI2kJEMSNIL9S2dpCLjUq9QR/yUbEPKw X-Received: by 2002:a05:6402:2b88:b0:43a:6c58:6c64 with SMTP id fj8-20020a0564022b8800b0043a6c586c64mr27217450edb.348.1661989243171; Wed, 31 Aug 2022 16:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661989243; cv=none; d=google.com; s=arc-20160816; b=Ln9Ek9oi4iL9Smzs+/h4HPIE9kvK+x7gDu7Ez1t9hg+XKf/dxEkpsLgELX0XR5CPU+ 3Asu8iWGymvV2hWu61GOOggVGIQ0B3gS2YTh7vPPghi+JPWOXsanvyIGOW9ZqAmj/kyz CBZtIpKZiQVzoE7hPxxdBZvMGmILjJpkGafGJ+upfwt6xV0BD/ljh7DQu5hrGXSphu/Q NmcG99v2LCq5DOM94hf0kFWZCAz8XfsTkGT88cc6/KpBoFQ4u6TmYoPDPuVFx32tSjFn Qk/XpPh6i7n2cPCHXd3bCcfOsmydItpGMwWHdD5Pa80mq+bzkpNCGNkz0Yz1YHL438Ad Gwyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8cRj+wC2SekV3g/lnG7OaUo/IWIUcAUM42NCJCbEaVU=; b=y3AkU6SgBAS4YIwWweo38363OKpRrl50F4xWKqiNodsXfdem830yWAD09v36P0jtPU UvqxpU4QZeeB/n0MSISnx7V/KYrtFq958Y205KwBm2vVrfdzMNK8Efm2vm3HVMN2VrFs oCS5wS5rORmt8msgjLdWJAv+5mL2TUJZ138YL3+cZly1nztBhcmoAFPO6TCcm3KRccVm 0D3gYv9Gx9djfH+MrZ7viyMYx4H4Tt19HzUhqp6wJ5zAL3BJ2C6Dwn44952zC1DGDTt/ 6xbhZJV7CqDO56xO/yrFl+58OlnI2svD8gXYYuutwlQKXkmlohZnGWbtZMWqDV3fao5G +A6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=SEtJIjyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr37-20020a1709073fa500b00730e4be74d1si16316850ejc.815.2022.08.31.16.40.12; Wed, 31 Aug 2022 16:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=SEtJIjyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232624AbiHaXYy (ORCPT + 99 others); Wed, 31 Aug 2022 19:24:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbiHaXYw (ORCPT ); Wed, 31 Aug 2022 19:24:52 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D57B4E0A for ; Wed, 31 Aug 2022 16:24:46 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id z72so13236473iof.12 for ; Wed, 31 Aug 2022 16:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=8cRj+wC2SekV3g/lnG7OaUo/IWIUcAUM42NCJCbEaVU=; b=SEtJIjyCH/OQa4i3YC29am3HN/68LbFFcD8vT8/EgqO7o/yoqct/Ln6fk4qC3798Fx 5ztkrHm3A1FboO+14txXalKKEuSSxOzdiErfBgd2jU1l0EqOoiPC3wUMhQScId2Va1sK NuEAUpvc6YxwuZOjsNsdCt71L3tNBatIKZ8FA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=8cRj+wC2SekV3g/lnG7OaUo/IWIUcAUM42NCJCbEaVU=; b=rzVx6QYRPvX0HAdsXF9tnKbhvartoaIh+SCuUDAx1C/wNkGZSnbPlKV16SFmEyMxx/ hRH+RQVY/zK4CRgSrx6aGan/KGy63Hq1OROGq+0dyFiKnkWNeGE1E/lY8hdmOmn2cH8V VqLBWKDpdXckKl6lFHSGstnV/7fgLR9nILQHT9SpFQhOn3BbVxnhwzpraB4KSinZS85H Ul+PdTsxTLMCIaBd6FeASJFR/4XBhU7EUKCJRaWTW5i9KOcutFu457a0BFkstMbQtr0S lR+D0WSfdYa0Tlm2nORkDQcCuqAjtdsNmJjPVegbGzQnLxPDI8tQni+1lfEJZKcqwQ+D 72xQ== X-Gm-Message-State: ACgBeo0BbY8aGwESLwcCkE3ApsnxeM9u4c2QY5JCYeRJbCjVtN+RU/ab MUBIAbd0KLEe/YiyLOEgKXHDZUEWR75cGg== X-Received: by 2002:a05:6638:4197:b0:349:fc58:d66a with SMTP id az23-20020a056638419700b00349fc58d66amr15951690jab.101.1661988286255; Wed, 31 Aug 2022 16:24:46 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id u190-20020a0223c7000000b00343617e8368sm7417114jau.99.2022.08.31.16.24.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 16:24:45 -0700 (PDT) Message-ID: <8552fc36-305f-d365-a2a0-b341bee14323@linuxfoundation.org> Date: Wed, 31 Aug 2022 17:24:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH -next 2/5] selftests/cpu-hotplug: Replace exit with return Content-Language: en-US To: Zhao Gongyi , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: shuah@kernel.org, akpm@linux-foundation.org, akinobu.mita@gmail.com, Shuah Khan References: <20220830083028.45504-1-zhaogongyi@huawei.com> <20220830083028.45504-3-zhaogongyi@huawei.com> From: Shuah Khan In-Reply-To: <20220830083028.45504-3-zhaogongyi@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/22 02:30, Zhao Gongyi wrote: > Replace exit with return to avoid some offline cpu > left when offline cpus fail. > Some cpus will be left in offline state when online function exits ... Can you state this clearly in the change log. > Signed-off-by: Zhao Gongyi > --- > .../selftests/cpu-hotplug/cpu-on-off-test.sh | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh > index 1169ef82b55e..19028c4c9758 100755 > --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh > +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh > @@ -4,6 +4,7 @@ > SYSFS= > # Kselftest framework requirement - SKIP code is 4. > ksft_skip=4 > +retval=0 > > prerequisite() > { > @@ -102,10 +103,10 @@ online_cpu_expect_success() > > if ! online_cpu $cpu; then > echo $FUNCNAME $cpu: unexpected fail >&2 > - exit 1 > + let retval=$retval+1 > elif ! cpu_is_online $cpu; then > echo $FUNCNAME $cpu: unexpected offline >&2 > - exit 1 > + let retval=$retval+1 > fi > } > > @@ -128,10 +129,10 @@ offline_cpu_expect_success() > > if ! offline_cpu $cpu; then > echo $FUNCNAME $cpu: unexpected fail >&2 > - exit 1 > + let retval=$retval+1 > elif ! cpu_is_offline $cpu; then > echo $FUNCNAME $cpu: unexpected offline >&2 > - exit 1 > + let retval=$retval+1 > fi > } > > @@ -201,7 +202,7 @@ if [ $allcpus -eq 0 ]; then > offline_cpu_expect_success $present_max > online_cpu $present_max > fi > - exit 0 > + exit $retval > else > echo "Full scope test: all hotplug cpus" > echo -e "\t online all offline cpus" > @@ -291,3 +292,5 @@ done > > echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error > /sbin/modprobe -q -r cpu-notifier-error-inject > + > +exit $retval This retval can be ksft_skip value if 4 of them fail. The test result will be incorrect in this case and will be reported as a skip. Let's avoid that case. thanks, -- Shuah