Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3138194pxb; Sat, 26 Mar 2022 11:50:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrkr4xOl8kofO4ZvpoxjBEF4g01ESRm7W8lgUfZG+4f8RqkINtFgXTY4ucrgPcnKy3b8MQ X-Received: by 2002:a17:90a:5ae4:b0:1bf:9c61:6973 with SMTP id n91-20020a17090a5ae400b001bf9c616973mr20152757pji.73.1648320650839; Sat, 26 Mar 2022 11:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648320650; cv=none; d=google.com; s=arc-20160816; b=l3gpbdbO8I8899WCtc4pVGpMc9VuolAi5g0dbUbNTkeakiVU6SuZ6k9wZv78a7zfg6 2nwSDp4aX4OFPyzhZh4ebSkvp+H5lY1fXrekjpbUDwO/TWUMlpbzI1Wukl2vujE40WzM IWEN1oBN3QibrevEcsmRnsODsMktnqlX7LOODuGGCDROQEl9XhlJo4tBPT74a2RlUXOw 64FjY2KnQAKLN8ilgC9UngMIC3YTQ1DnspRXMFwkiFpdBI2TUS2mrADOC4XKXIacBIYy Eyg65Yrq4ErI9QQ/CeqqEObEIlCV4YwH/aQQ+ycpp9LBsnniYCC5DqTQG+R4ninAfKnG J8Zw== 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=iw72GKEMi/crj2ezQ5uanSO0mUM4G75d8+OaXVTmjn8=; b=XUGWivb0kFx1XQDdVeKcJLW5UAr3dKcZV6avk79InH7xUyKMaHEx8OXwJ3BmX1gVJM wxOw5wL/asdK2EklZfdRPL041X8ulrFIWJnjskrJ8UghcvyBGNlRXySzP0ABDGpwydKh 8bUr77r1mfrf3Ffr8wVVcSwdoWFVM8GK+MW8Y3o4+hZNiZNdsh3cm13Zt/QAswnZZtmK 8hP82tITWEMUrYOVFfbGU2f7IuqftA06P68dePxFbFE77Kua56kWZ9pjTSV33Ih9rKoA /HFrpWDVlLP0bozdGDsMIjoKst3ZO4QUBARXkQuej9AzpxIN2weMIF8T+yUBsKezTCTE a5XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u206-20020a6279d7000000b004fa92f4725dsi6712984pfc.32.2022.03.26.11.50.37; Sat, 26 Mar 2022 11:50:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbiCZG3n (ORCPT + 99 others); Sat, 26 Mar 2022 02:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbiCZG3R (ORCPT ); Sat, 26 Mar 2022 02:29:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A07A2E68F; Fri, 25 Mar 2022 23:27:42 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KQTXJ1VSHz1GD1t; Sat, 26 Mar 2022 14:27:28 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 26 Mar 2022 14:27:40 +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.2308.21; Sat, 26 Mar 2022 14:27:38 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 5/9] mm: Ratelimited mirrored memory related warning messages Date: Sat, 26 Mar 2022 14:46:28 +0800 Message-ID: <20220326064632.131637-6-mawupeng1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20220326064632.131637-1-mawupeng1@huawei.com> References: <20220326064632.131637-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 b12a364f2766..19ae4a63fc08 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; @@ -1385,7 +1385,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