From patchwork Wed Jun 1 14:51:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 12866929 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2D4FC433EF for ; Wed, 1 Jun 2022 14:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7wZVG4XoR2zHpiuBXijHEL37/dOVE4TkW14bN4JFDa8=; b=AJVe+YteUfYDNO XZi8/5y/ufjfGR69KGMxNaCVb5OEpq2tFxhHrEsmdKXLdjXpF/gD8h4pa4ckhPL+4ZU0ni0pAW5Ag u4uVCzF5TigELDdPr8xjNFoxvFI+SKoupVOebivHC5sVHqkuxHQjEs6W+uN86Yby9hwYPeIoz/vZa KDqwtsDgI9FaGwkfDwSgd6y+ABU13j8XEqTOulOMGSitjuqHmp138pbxtfn47xvCWteBULqFPTg8x hu0VRHgx1jRtRhScL5GXhsqpv5WftA4r9r8MWDxAl8isC1rpN0oXTlMasD/luAbhObnGI5RJURnpU dGltW/c3E3Wr2hs0Azjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwPgv-00GmZr-1C; Wed, 01 Jun 2022 14:51:21 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwPgs-00GmXB-1C for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 14:51:19 +0000 Received: by mail-pf1-x431.google.com with SMTP id 187so2196743pfu.9 for ; Wed, 01 Jun 2022 07:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9Di3AWHfW2BtAUx+vGxYzLY0UoxmZ/0cEx6rZNq/IzQ=; b=F5M1gdd1//KZvxx+bojh2vf8rGxdfR/UiBy9WQbK8XpcJkbLuuAKuovT8O6O190tOn 13+aCTaADNFZr7O9eQAXwZxMy6eHSU2RbvA15JbsD7t+A6CHncAVF68uCkaPqFJ0lfi0 5dhmh/ftBV9ryrgNlsyFYl3Fdf/hH38oNqYX70lWFYXWR3PmohRY3Us9Kvko+m3qBb45 Iuw7pu7sn00h9jE4p0VC2kU3zo0JCOQWXc6MLGP/O1E80vRgs4T8dq9WSMeEaLXC3Bw6 GsfWiZjvjzH8/zEHtYhpD3WG2CkrxqRsCNtoR3oq0lLWxo1NhifLs4WAMnoGweC2ttP/ 79wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9Di3AWHfW2BtAUx+vGxYzLY0UoxmZ/0cEx6rZNq/IzQ=; b=w6uHPnc9HNldCSlVS3wksB1+TS01rp4Zt6bxlv+AwnA8W/wvjslf/wSeqZD807tuxz YylJew51YUn5CYdwbYtXiSrkOdiwwdAalPEqfmKA7NNxfMSjGm9ARVFMXPlcJzqKSidF hYVmdOuk9K+Q+ukrEKRJiPI94Mj3rcmGHRfB2puUCy4HvtbVFcA3TIC63HkVUtrQvJO8 Kl2VaT+k2cypavN6uhZidVYSoXu9b7geLhky7rkdG5YuJyMt++7c1ciSgeSE+PWdsa4S /CWu/Igw/UuvO3uVAzfrxnOx1rVPcIk8d+8bNT7bTzNZJCWTBWPx0cSqDpMyLOlUSlNp 8+jA== X-Gm-Message-State: AOAM532tN7UtKMIG1ybQmSDMKbA7aQe0d9lI3o/+K0i5FO04BPJ2BWi5 cvJKXYqgFiK0WItHDYuiDN0= X-Google-Smtp-Source: ABdhPJz9f79ygetP+6T69yOPHwSS/S9j4pj9KLO4dR2e/0Cf8gyv0fo6E+OzSx2kzLuYhi9Pr8/wAQ== X-Received: by 2002:a05:6a00:2181:b0:51b:560b:dd30 with SMTP id h1-20020a056a00218100b0051b560bdd30mr13725422pfi.44.1654095075073; Wed, 01 Jun 2022 07:51:15 -0700 (PDT) Received: from localhost ([2a00:79e1:abd:4a00:2703:3c72:eb1a:cffd]) by smtp.gmail.com with ESMTPSA id w124-20020a623082000000b0050dc76281f8sm1588608pfw.210.2022.06.01.07.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 07:51:13 -0700 (PDT) From: Rob Clark To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Christoph Hellwig , Robin Murphy , Rob Clark , Marek Szyprowski , iommu@lists.linux-foundation.org (open list:DMA MAPPING HELPERS) Subject: [PATCH v2] dma-debug: Make things less spammy under memory pressure Date: Wed, 1 Jun 2022 07:51:16 -0700 Message-Id: <20220601145116.280040-1-robdclark@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_075118_116154_B8ED5A82 X-CRM114-Status: GOOD ( 14.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rob Clark Limit the error msg to avoid flooding the console. If you have a lot of threads hitting this at once, they could have already gotten passed the dma_debug_disabled() check before they get to the point of allocation failure, resulting in quite a lot of this error message spamming the log. Use pr_err_once() to limit that. Signed-off-by: Rob Clark --- v2: Use pr_err_once() instead of ratelimited, and spiff out commit msg a bit. kernel/dma/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index f8ff598596b8..754e3456f017 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -564,7 +564,7 @@ static void add_dma_entry(struct dma_debug_entry *entry, unsigned long attrs) rc = active_cacheline_insert(entry); if (rc == -ENOMEM) { - pr_err("cacheline tracking ENOMEM, dma-debug disabled\n"); + pr_err_once("cacheline tracking ENOMEM, dma-debug disabled\n"); global_disable = true; } else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) { err_printk(entry->dev, entry,