Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2400386pxb; Tue, 9 Mar 2021 01:18:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvrHYN36xIXZWMoGgrAoOUzvW+0HtrRuyqsBv5COZCJJwbaL+Glg3mCTm77mGwo2Ma/yav X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr3009704edd.78.1615281481941; Tue, 09 Mar 2021 01:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615281481; cv=none; d=google.com; s=arc-20160816; b=D1Z0CPTQk27qEXb161HzEClvmN2QvDGR68LfViJAMTY2IyTAswe/X9W4T5q7R1CuvQ 69DTAbNGsjyJ0OnnVBJUcbSARIYb/bAyLlaLY4njL8uIjybxy7Dl5uwgaLrdsD8GyjIa IBgoHpkIV6F6oH0NRuFEs+gDPqICazJHq5oSBmicTfHF0sxq/3+BVzz4wnA7LnnQoiDY RWLnjb2xqUHH6xAKeUxBXlsAv1jMuzWMh6kflDCkrbaRHgQPMPi6DINixH47VFtgmqrK GqAA+uDQ2p9MgoyWkMkOGpLxr9C4aXKilHIsUfBoJGvdZhydHXoQy8V3RGBcY0mj98d9 3uqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=L9j86tZwdWBCIaA3iqw1K0HT50/k7IuHPZDEMk8IblY=; b=TrtgODLBhJvLR7ssMY3f6p1SwwUEbsmd+6va4nda1Y5yXQLLtAUs8YXCGlITS/Nqrg +s6qdZJtC/wCxSpcKDNq6R4nMLzYCOIMr7k3IEu3xqx70KHxGH2gfypqo8MrNqx+q0MA OP9c1mq43fmoToL8F4B5niRaDkZd+D1VXsmDw1OK2FEQGy14uTXD8SLV1ef3XoUMg1wB Sf0hFxLRsfpg71jr4xGEgonGD/EW3tg20/NNzb0fNccMrsCw5zgc+vbstUIIZL21gnQg FcVUPBpPMBXsQty05RRvErMide0RnLq/Q7QXA8+y9wnJAzvIgvyEM3Onju7r1TZl9mBx DqqA== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si8392824eje.586.2021.03.09.01.17.38; Tue, 09 Mar 2021 01:18:01 -0800 (PST) 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbhCIJQn (ORCPT + 99 others); Tue, 9 Mar 2021 04:16:43 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:35043 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhCIJQR (ORCPT ); Tue, 9 Mar 2021 04:16:17 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R881e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UR4gh8C_1615281374; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0UR4gh8C_1615281374) by smtp.aliyun-inc.com(127.0.0.1); Tue, 09 Mar 2021 17:16:14 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: cma: Use pr_err_ratelimited for CMA warning Date: Tue, 9 Mar 2021 17:16:06 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we did not reserve extra CMA memory, the log buffer can be easily filled up by CMA failure warning when the devices calling dmam_alloc_coherent() to alloc DMA memory. Thus we can use pr_err_ratelimited() instead to reduce the duplicate CMA warning. Signed-off-by: Baolin Wang --- mm/cma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/cma.c b/mm/cma.c index 54eee21..d101bdb 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -500,8 +500,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, } if (ret && !no_warn) { - pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n", - __func__, cma->name, count, ret); + pr_err_ratelimited("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n", + __func__, cma->name, count, ret); cma_debug_show_areas(cma); } -- 1.8.3.1