Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp392481pxv; Wed, 30 Jun 2021 07:59:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFEwhlK/aWNxj9wk1hosLPVoV0dCyyLkYoPbperrIRl8NgclaxGriO5ed7S+IWqRUgUmtw X-Received: by 2002:a17:907:3e28:: with SMTP id hp40mr6016603ejc.381.1625065147892; Wed, 30 Jun 2021 07:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625065147; cv=none; d=google.com; s=arc-20160816; b=F5UgFt/A706IrF0DQuzXtySP9rxRwENWJs6JfmFK/UXhm3LHtexC2Vs1YaiGatWmI1 M34ZYPzV/QHIVaBluDpX1Kl8BKWK3Cl3vHyCSkkmgnAwC7xwrsjobn7htIHO0i5e2Vax eFNnx/WrV6Tc8kWOj1bJSvd0JlBDwNGYd3RIoNf2oXKDYbLs1xfyunCQueouA3yaMcby AAUkOqMePYk60ac+gmVVur11TrPMWHqfmHhu+EaZ3dZhIniUmoH32TGSi8V96l+773fj H3TqYHz/hLOh7N3sxYuYyWFpYUrTOJbKVMuwaL+14DlMtKaZA/hPQJY4xjlXdrCP9w1q RWbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=edr/E69FivqWRSmr44P380n2G5HdlLIZIttytXmtVVo=; b=TxukyhfkH+D2v3WDVXR8ktHjItG0YcTBjT8zGsqjz3+hVx+I6bjz23Ay5rV5Bi76bm OxIes/99Ntm5H16WufbspDmfiEzQl52HkcIn5158q/8GGGwDxe2sdeIOBEd6e4YmrF5v MsJMrVT9GSShdA+/1GilokOIR+M88W/cM9Sp/h/b5kmFgGJDWU8ecUwxNCK5dXh9sggD sv3zzOJZBLDO5hh9VunEpAdCzZp1Fus6pSr0reHjUY7J4StR3RV96pigkCYtHfPCJvPw 13j5HdYT4qXD6mBspKbcTSUcb9WxCOJMlHCoGTmYR12nM76Cr3ssWLGbnjMGQEa/FmnB yabg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si21185294ede.303.2021.06.30.07.58.43; Wed, 30 Jun 2021 07:59:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235405AbhF3PAL (ORCPT + 99 others); Wed, 30 Jun 2021 11:00:11 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38806 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235177AbhF3PAK (ORCPT ); Wed, 30 Jun 2021 11:00:10 -0400 Received: from 1.general.ppisati.uk.vpn ([10.172.193.134] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lybem-0007i0-Qi; Wed, 30 Jun 2021 14:57:40 +0000 From: Paolo Pisati To: Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: memory-hotplug: avoid spamming logs with dump_page(), ratio limit hot-remove error test Date: Wed, 30 Jun 2021 16:57:40 +0200 Message-Id: <20210630145740.54614-1-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While the offline memory test obey ratio limit, the same test with error injection does not and tries to offline all the hotpluggable memory, spamming system logs with hundreds of thousands of dump_page() entries, slowing system down (to the point the test itself timeout and gets terminated) and excessive fs occupation: ... [ 9784.393354] page:c00c0000007d1b40 refcount:3 mapcount:0 mapping:c0000001fc03e950 index:0xe7b [ 9784.393355] def_blk_aops [ 9784.393356] flags: 0x3ffff800002062(referenced|active|workingset|private) [ 9784.393358] raw: 003ffff800002062 c0000001b9343a68 c0000001b9343a68 c0000001fc03e950 [ 9784.393359] raw: 0000000000000e7b c000000006607b18 00000003ffffffff c00000000490d000 [ 9784.393359] page dumped because: migration failure [ 9784.393360] page->mem_cgroup:c00000000490d000 [ 9784.393416] migrating pfn 1f46d failed ret:1 ... $ grep "page dumped because: migration failure" /var/log/kern.log | wc -l 2405558 $ ls -la /var/log/kern.log -rw-r----- 1 syslog adm 2256109539 Jun 30 14:19 /var/log/kern.log Signed-off-by: Paolo Pisati --- tools/testing/selftests/memory-hotplug/mem-on-off-test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b37585e6aa38..46a97f318f58 100755 --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh @@ -282,7 +282,9 @@ done # echo $error > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error for memory in `hotpluggable_online_memory`; do - offline_memory_expect_fail $memory + if [ $((RANDOM % 100)) -lt $ratio ]; then + offline_memory_expect_fail $memory + fi done echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error -- 2.30.2