Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp32757lfe; Fri, 15 Apr 2022 18:04:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ/dfqDFHuVL99IEDiZ7yq+9dv1dtQFHBWS9C6sDuFOALGWrBguhUmtt5K4lnSTKh/kH0u X-Received: by 2002:a05:6a00:1955:b0:505:7902:36d3 with SMTP id s21-20020a056a00195500b00505790236d3mr1421343pfk.77.1650071081461; Fri, 15 Apr 2022 18:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650071081; cv=none; d=google.com; s=arc-20160816; b=H8TbDny6+FOWjUiQwrJLZ0JtemzawZfJg5GAXfZ/II+3Xk9kKgHuvV8qKRQppP3we+ kVsay9a1kBdZa/BkwxjDAh27PnulaAISbwSv7JZ5lzHuTqkIxIQlASGm2JSGyC23MFTZ LlXglhIaD9Bw9xTMx2CWa0z+TdtuuJcla9YSQOnafKBecrfUE55yAGUr+FANqnOMbZov VG9axHSM/9EDqQonZZMJuFeBmm8oD8A4Ee9cfLVGhqDUpdcQJXMX6PGkOg9PJy9ijw2v 2pJw/ZZE1mK/SvFfq/vbh4m7LKE5/Y5pAeRYDd/rBfEobmo7CPK4/O4sx1rHv1zJEi7S hd5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zX619hVXEj9eG6kN6StM1WUVli2XrqAtBPBsymtXZsA=; b=PMPBp09yWe69jwvWRVldaCjVsQv/5fVqSon2iXz8s1JFAw5RayuyZwz7rwB5OMvktE hnS2qOAHr+FiD+BbEdu+d2WsqbxRnwXWQzRemUH93k6W4XIQcbnxzg/dW7ddL9zvLamx 6XfiWvTp8qrlTzH8nrj/gGTf53KPoRmWHHVKJGm5zCnvrzDaqXrx6atoFOJJIbTG/uDO pJJf1SADb7MdSDPumH/BH56/I1YC59Sf0KdgQN3cC2OfnMfPC8bRJHxMx0kMVo6treuI xOrRfLB9/dguWMHILINVALJqyQE6wyi2McyKUMW3kE/ONl3vSRmm7JReQrZ6UBZxDsNU +2eg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e24-20020a635018000000b0039cef730af0si2633386pgb.608.2022.04.15.18.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:04:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6AFDDF47CC; Fri, 15 Apr 2022 17:45:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242151AbiDNJ5X (ORCPT + 99 others); Thu, 14 Apr 2022 05:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242008AbiDNJ5D (ORCPT ); Thu, 14 Apr 2022 05:57:03 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50CC120BE; Thu, 14 Apr 2022 02:54:36 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KfFBN63JSzgYlp; Thu, 14 Apr 2022 17:52:44 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 14 Apr 2022 17:54:34 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 14 Apr 2022 17:54:33 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 5/9] mm: Ratelimited mirrored memory related warning messages Date: Thu, 14 Apr 2022 18:13:10 +0800 Message-ID: <20220414101314.1250667-6-mawupeng1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20220414101314.1250667-1-mawupeng1@huawei.com> References: <20220414101314.1250667-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Ma Wupeng 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 --- 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.18.0.huawei.25