From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38ED5ECAAA1 for ; Fri, 9 Sep 2022 12:21:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7E698D0003; Fri, 9 Sep 2022 08:21:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A2E8B8D0002; Fri, 9 Sep 2022 08:21:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D23B8D0003; Fri, 9 Sep 2022 08:21:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7B2E58D0002 for ; Fri, 9 Sep 2022 08:21:56 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1451F40A21 for ; Fri, 9 Sep 2022 12:21:56 +0000 (UTC) X-FDA: 79892458632.13.5F5779C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id A688618007E for ; Fri, 9 Sep 2022 12:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662726115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wpKZaZKB6OuIOUbNK0QXmxRia5uDsfJYJGNMehBpaeQ=; b=Gg28gKJ3uKapzabdcjs/ovSkjmzQHcse7/DT6PFfTqWsw+hYpR7ACfBtTyuGGGiV/+5xuy N7xGMSXUYiUl8By9l0ewwMVmj8Q+DdQE+Rz0WnpSaZ/PBT87lvB2r1bpSRU/W3tFQGIMx0 ZohYkQ23f6xUZy3z3J76XaWgPtdxaW8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-80-1IhNVJntNs6ihP9RK0K36w-1; Fri, 09 Sep 2022 08:21:54 -0400 X-MC-Unique: 1IhNVJntNs6ihP9RK0K36w-1 Received: by mail-wm1-f71.google.com with SMTP id bg2-20020a05600c3c8200b003b33080cff8so1112337wmb.0 for ; Fri, 09 Sep 2022 05:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=wpKZaZKB6OuIOUbNK0QXmxRia5uDsfJYJGNMehBpaeQ=; b=72cwQqDu7Fjs/GHIK48zVCkhw3kvcoxRbkuzCTqnw5M3G/nIr/62v2vYGdRjzUK2ov tG6L4pGTJe3CvAilzXJW5QvNKVN07BAeOE/ifP/KtrvMhuwGUZPFasLlFogkZJDjxJzN 17WROpWrfFBrsRwotNb4PV+SAshQWtR81nvx6Yz6BOuL4oW14CDRz7EfCCotOgJplmN7 6aIjpIL2VhS0WhRYbtQNqR3fYr3RL9J1ygloeh0VFzlqrh7Kx0hL49kkBuQIvUeiCZq9 Bt09N4GGJQwJNoBxuxEULX9sJMTwx5LUs+t7MbyYO17V+peHT1GizYCNB2B7sLs5B7a0 XmRQ== X-Gm-Message-State: ACgBeo0IPUSugEdJCCHSEiYUSJLO56OFtSaDk3nWGdnTSEfUyurdfAdM cezOmJvfEGxnj6w/DYMQxyZQ0zCTA40nlzqQWo+eSjwdlXCPTG8jfJvSR1TI/QiDy3FkZJXVx8j 3WpSbpoLzVMk= X-Received: by 2002:a5d:588a:0:b0:228:462f:a49 with SMTP id n10-20020a5d588a000000b00228462f0a49mr8372602wrf.616.1662726112730; Fri, 09 Sep 2022 05:21:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR4zCe6lDbEZptsQT9dTPwb/AYvVBjW5axO/MWFBwE2Vrd8p4VQ+FCvkXzdgnWOwMPwcYhUpUA== X-Received: by 2002:a5d:588a:0:b0:228:462f:a49 with SMTP id n10-20020a5d588a000000b00228462f0a49mr8372589wrf.616.1662726112488; Fri, 09 Sep 2022 05:21:52 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:6300:1fe0:42e1:62c5:91b6? (p200300cbc70463001fe042e162c591b6.dip0.t-ipconnect.de. [2003:cb:c704:6300:1fe0:42e1:62c5:91b6]) by smtp.gmail.com with ESMTPSA id q127-20020a1c4385000000b003a5f54e3bbbsm429713wma.38.2022.09.09.05.21.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 05:21:52 -0700 (PDT) Message-ID: Date: Fri, 9 Sep 2022 14:21:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit To: Zhao Gongyi , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Cc: akinobu.mita@gmail.com, corbet@lwn.net, osalvador@suse.de, shuah@kernel.org References: <20220909075200.198363-1-zhaogongyi@huawei.com> <20220909075200.198363-5-zhaogongyi@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909075200.198363-5-zhaogongyi@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662726115; a=rsa-sha256; cv=none; b=VVhwFG8lWWWXbD6PMm8w5JIvcCy1gzIAnx89zWh0/qazoTQPay74IsLNs3WI63PXUzQ6WF HOLXehvHeO/0g/HGuT0Gm9DM7Mh8MN0mWrCX7PmqWRNtMtW/g3MetvMblzp5d+q8wj8njt QmpRJR7S1IkkLwB1+dct0iWhQhv9goo= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gg28gKJ3; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662726115; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wpKZaZKB6OuIOUbNK0QXmxRia5uDsfJYJGNMehBpaeQ=; b=2M5SOZ1lGdEhWF7hSK9SvUGIQwNXUvK/7FoDPtUTVAIPvrKytK3cT0v9xea6+WV37HlDzb 3Iz1X6gtSvu59zULEeH5M8Eg4n6ZsSgcIQElm0SpPXK8Qpb8SFlN0xrGHtb5kKktx8zjSQ JbHO1bTTNRr6WBAXK+RxpiiDWcxS2v4= X-Stat-Signature: 181m9ymtn16mpog6twesis7by17qjgjz X-Rspamd-Queue-Id: A688618007E X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Gg28gKJ3; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1662726115-167436 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 09.09.22 09:51, Zhao Gongyi wrote: > Some momory will be left in offline state when calling > offline_memory_expect_fail() failed. Restore it before exit. > > Signed-off-by: Zhao Gongyi > --- > .../memory-hotplug/mem-on-off-test.sh | 24 +++++++++++++------ > 1 file changed, 17 insertions(+), 7 deletions(-) > > 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 3bdf3c4d6d06..259fd8978639 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,17 @@ offline_memory_expect_fail() > return 0 > } > > +online_all_hot_pluggable_memory() > +{ > + > + for memory in `hotpluggable_offline_memory`; do > + online_memory_expect_success $memory || { > + echo "online memory $memory: unexpected fail" > + retval=1 > + } > + done > +} Maybe call it "online_all_offline_memory()" instead? Note that "removable" as used in hotpluggable_memory() will nowadays always return "1" if the kernel supports memory hotunplug, independent of the specific memory block. -- Thanks, David / dhildenb