lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220614092156.1972846-3-mawupeng1@huawei.com>
Date:   Tue, 14 Jun 2022 17:21:53 +0800
From:   Wupeng Ma <mawupeng1@...wei.com>
To:     <corbet@....net>, <will@...nel.org>, <ardb@...nel.org>,
        <catalin.marinas@....com>
CC:     <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
        <dave.hansen@...ux.intel.com>, <x86@...nel.org>, <hpa@...or.com>,
        <dvhart@...radead.org>, <andy@...radead.org>, <rppt@...nel.org>,
        <akpm@...ux-foundation.org>, <paul.walmsley@...ive.com>,
        <palmer@...belt.com>, <aou@...s.berkeley.edu>,
        <paulmck@...nel.org>, <keescook@...omium.org>,
        <songmuchun@...edance.com>, <rdunlap@...radead.org>,
        <damien.lemoal@...nsource.wdc.com>, <swboyd@...omium.org>,
        <wei.liu@...nel.org>, <robin.murphy@....com>, <david@...hat.com>,
        <mawupeng1@...wei.com>, <anshuman.khandual@....com>,
        <thunder.leizhen@...wei.com>, <wangkefeng.wang@...wei.com>,
        <gpiccoli@...lia.com>, <chenhuacai@...nel.org>,
        <geert@...ux-m68k.org>, <vijayb@...ux.microsoft.com>,
        <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-efi@...r.kernel.org>, <platform-driver-x86@...r.kernel.org>,
        <linux-mm@...ck.org>, <linux-riscv@...ts.infradead.org>,
        Mike Rapoport <rppt@...ux.ibm.com>
Subject: [PATCH v5 2/5] mm: Ratelimited mirrored memory related warning messages

From: Ma Wupeng <mawupeng1@...wei.com>

If system has mirrored memory, memblock will try to allocate mirrored
memory firstly and fallback to non-mirrored memory when fails, but if with
limited mirrored memory or some numa node without mirrored memory, lots of
warning message about memblock allocation will occur.

This patch ratelimit the warning message to avoid a very long print during
bootup.

Signed-off-by: Ma Wupeng <mawupeng1@...wei.com>
Reviewed-by: David Hildenbrand <david@...hat.com>
Acked-by: Mike Rapoport <rppt@...ux.ibm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 mm/memblock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index e4f03a6e8e56..b1d2a0009733 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -327,7 +327,7 @@ static phys_addr_t __init_memblock memblock_find_in_range(phys_addr_t start,
 					    NUMA_NO_NODE, flags);
 
 	if (!ret && (flags & MEMBLOCK_MIRROR)) {
-		pr_warn("Could not allocate %pap bytes of mirrored memory\n",
+		pr_warn_ratelimited("Could not allocate %pap bytes of mirrored memory\n",
 			&size);
 		flags &= ~MEMBLOCK_MIRROR;
 		goto again;
@@ -1384,7 +1384,7 @@ phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
 
 	if (flags & MEMBLOCK_MIRROR) {
 		flags &= ~MEMBLOCK_MIRROR;
-		pr_warn("Could not allocate %pap bytes of mirrored memory\n",
+		pr_warn_ratelimited("Could not allocate %pap bytes of mirrored memory\n",
 			&size);
 		goto again;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ