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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC34EC43334 for ; Fri, 10 Jun 2022 09:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346669AbiFJJah (ORCPT ); Fri, 10 Jun 2022 05:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348172AbiFJJaO (ORCPT ); Fri, 10 Jun 2022 05:30:14 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3133D14C758; Fri, 10 Jun 2022 02:29:09 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LKFyQ3zdlz9sw6; Fri, 10 Jun 2022 17:28:46 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 10 Jun 2022 17:29:07 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 10 Jun 2022 17:29:05 +0800 Message-ID: <1dca24a0-b538-86c1-a0f5-68fad15e76fe@huawei.com> Date: Fri, 10 Jun 2022 17:29:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 3/6] mm: Ratelimited mirrored memory related warning messages Content-Language: en-US To: Wupeng Ma , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <20220607093805.1354256-1-mawupeng1@huawei.com> <20220607093805.1354256-4-mawupeng1@huawei.com> From: Kefeng Wang In-Reply-To: <20220607093805.1354256-4-mawupeng1@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/6/7 17:38, Wupeng Ma wrote: > 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; > } Reviewed-by: Kefeng Wang