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 93351C433F5 for ; Mon, 10 Oct 2022 06:54:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D9E56B0071; Mon, 10 Oct 2022 02:54:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 188076B0073; Mon, 10 Oct 2022 02:54:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 001646B0074; Mon, 10 Oct 2022 02:54:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DCD866B0071 for ; Mon, 10 Oct 2022 02:54:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A015A160305 for ; Mon, 10 Oct 2022 06:54:17 +0000 (UTC) X-FDA: 80004125754.14.08DC2C4 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 9CC1E180010 for ; Mon, 10 Oct 2022 06:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665384855; 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=Pg5G9VL5CpW466Qb5kzC3fS+GraPCe+CdwnleWArycc=; b=cIHo9N2zwrAYRhlN3HHIGTdzNV+lIeQYurdvF2D7Boa6h7B1MUEiy84PTMWJFwmWwzjcTb ubGwcmu3r49ua6Br+evdqq1LOq35r5Rra7LcC/U5seI6TpYQcW6mPZY3bA0jn/6TXA8MAq b83PgyV/h4NtcgHDimdjYx3xDkddRpc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-312-iC9q3MDlMXKqrNp59qytPw-1; Mon, 10 Oct 2022 02:54:06 -0400 X-MC-Unique: iC9q3MDlMXKqrNp59qytPw-1 Received: by mail-wr1-f71.google.com with SMTP id k30-20020adfb35e000000b0022e04708c18so2394391wrd.22 for ; Sun, 09 Oct 2022 23:54:06 -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:message-id :reply-to; bh=Pg5G9VL5CpW466Qb5kzC3fS+GraPCe+CdwnleWArycc=; b=bCEn3A2yMRU/BtBDoyZYQRSXgfeNTVv6A+Oigl3J0I/hP0rRb0xROTL08lnnegsxw9 yH4fvivms+k4cEGHNE8DGrsGAUAein2EZUS46PdRD0Ci8Dt+LPqfF6I4380uFFypHiSF Z0RM6ajRFr4BbfosMaro+IX8bo92Oj0MLbeCL6ElF4ySnqp4AYOl6xrWLTY+INV6bhJI /25yIsABRaM0yGlQhb3ic3eb8njGsjgMMT2T8c5Noy5md9EzsLcYpVmHhFGEsrpg4r6r AODKk7SqmEsHtBAgDm8NO8+Wkn5C1u2+KF4Ogkm9jkOALnaZMdX2fPPitvvcyCkiXLiD N8xg== X-Gm-Message-State: ACrzQf2ivDIn3ahJAVCwwCbBJJlI1pnuCPp0jxfvno0GNDWa7uS+5Qot OOeGNfrmpHrraItOq16dHl7qh7vsgvpL1vnBSsPICl7ISQrPNB1nBCo2iUOjynfhwIUCzgqnNOW WmhUpXylNDeA= X-Received: by 2002:a05:600c:4186:b0:3b4:a660:1d29 with SMTP id p6-20020a05600c418600b003b4a6601d29mr18631478wmh.120.1665384845741; Sun, 09 Oct 2022 23:54:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7V2dlW9YbkCCzqACXYKambIlk713mlq6z7oXm6nZyP2WjnrSh/2V7hTzCymmXg6z+PUAe1lg== X-Received: by 2002:a05:600c:4186:b0:3b4:a660:1d29 with SMTP id p6-20020a05600c418600b003b4a6601d29mr18631464wmh.120.1665384845488; Sun, 09 Oct 2022 23:54:05 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:e600:3a4a:f000:b085:4839? (p200300cbc704e6003a4af000b0854839.dip0.t-ipconnect.de. [2003:cb:c704:e600:3a4a:f000:b085:4839]) by smtp.gmail.com with ESMTPSA id j5-20020a05600c1c0500b003b477532e66sm35460629wms.2.2022.10.09.23.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 23:54:05 -0700 (PDT) Message-ID: Date: Mon, 10 Oct 2022 08:54:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit To: zhaogongyi , "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: From: David Hildenbrand Organization: Red Hat In-Reply-To: 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=1665384857; a=rsa-sha256; cv=none; b=PmI717NEyBiZUjXpnw+pxOYxBBXJWcKL94sz/EgiIu5VU3M4sDsFyJltMFxibxaGebwlIQ /NiVCdkwPWkKEXAq5phMXX2xeKtrO66KIngNeLSi91AL5dv+FlG5opqf1JUaVAK5HDCOXJ UWjTnGCx9JqcQIzWHPvQgwTK1o1nsb4= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cIHo9N2z; 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=1665384857; 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=Pg5G9VL5CpW466Qb5kzC3fS+GraPCe+CdwnleWArycc=; b=6XCJcuVBPYEjRyT6weT047uBmiFBC3R8OAgMbO3mJ50bBAYLJimP0U39ocYzfu6mOFInhy +7e2Qv9OMAkOhXcIhq/nccf5o3zTyz0bW57Iew1KCc6qoPjOzxJ+WDvcs38h5wvA8l2tpc KJGnk7eZugztsUmeZXUZ8wQatmUcp3k= Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cIHo9N2z; 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-Stat-Signature: egp6gjsxz3ryu67omkt8w64b7zthn6br X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 9CC1E180010 X-Rspam-User: X-HE-Tag: 1665384856-345494 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 08.10.22 03:40, zhaogongyi wrote: > Hi! > >> >> On 30.09.22 10:52, zhaogongyi wrote: >>> Hi! >>> >>>> >>>> On 30.09.22 08:35, 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 | 21 >>>> ++++++++++++++----- >>>>> 1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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 >>>> >>>> Do we need that output? >>> >>> In my opinion, if online a memory node failed ,it should be a kernel bug >> catched, so, I think the output here is needed. >> >> But online_memory_expect_success() already prints a warning, no? > > Yes, online_memory_expect_success() already prints a warning, remove the warning in online_all_offline_memory() seems ok, > > My previous consideration was that one more log information would make it easier to locate the wrong location. Let's keep it simple unless there is real reason to warn twice. -- Thanks, David / dhildenb