From patchwork Fri Nov 26 02:47:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Zhang X-Patchwork-Id: 12640065 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0ACAC433F5 for ; Fri, 26 Nov 2021 02:48:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2DBC6B0075; Thu, 25 Nov 2021 21:47:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB6036B0078; Thu, 25 Nov 2021 21:47:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D08666B007B; Thu, 25 Nov 2021 21:47:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id BA8426B0075 for ; Thu, 25 Nov 2021 21:47:52 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6A2AD1852554A for ; Fri, 26 Nov 2021 02:47:42 +0000 (UTC) X-FDA: 78849545922.20.7F0D836 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf17.hostedemail.com (Postfix) with ESMTP id 0A17FF0001D5 for ; Fri, 26 Nov 2021 02:47:41 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so7014182pjb.1 for ; Thu, 25 Nov 2021 18:47:41 -0800 (PST) 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=N2rR2M205RaoXv2F1eYgORsUa0WkEJokTNFyh0m1jbQ=; b=G2bPd47mof2kPWU7wel0/tp2qN5l0O1ock7AVXOCjPcUgfdz+VGKWkXiYcX9y1PbIN Uvx3tGvdiFsjdWcDUHq3iDhH1az6OWWLRddAnuGMRXuAQjASQdHm0ixSfecMUpL9le/f eTADybm0qsmMMNVCByp9gq7imYV3VqBKjQnhY0tHT+6qwCx8XaUXkvRuey9ymCNi0yau WoLtDhIwjwasn2UdJ3wxPeYWjNgn2rqVtt87k79XaOwIYg6V+MpeZQfne8XEZGhAs8qK uIbwyrBUBzoVG2kLvZH+NxhP6qMXM6q23hqGf/n2i4+UUUlxzn35ojINybmpkkIdY6PH B+cA== 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=N2rR2M205RaoXv2F1eYgORsUa0WkEJokTNFyh0m1jbQ=; b=tqnR5Qcx9OpGjekAZsvUu8FCkTqwHProx1EF1zvwlKwMV0FYb7+IpQxhbZVst3wW/L S94NWrAtAmWhkZqZMRNNSFolBRajvNOUAJCsUD9u5jjkSnx617Zsj4bnyo+ZRJZD9mre v/Ogo/je0wizpyaAK3vjD4WF64hZZBfkVtZeEb4ITbBNnAH+sDTuMgO6+I8/lMqpHsVP PAbwS+FT/m4JFVx0axNgaD6o08qT2MzyDasOZ81jJnCDY80SvzCrbSAWwXfkbWE+Yjep F8VZNxicwdhpczoEoCkLYBItk4EDfOjNTV4B7sxBjbyWcqvnGhcBAr8Qz8/wJdupIs3c EhSg== X-Gm-Message-State: AOAM532wluotwp1ncZEEVzrMBUxFTpGCbk+CexlzTh/Vt5qh434HF93j SzTpIKI4Hv5kL/QQfupURgI= X-Google-Smtp-Source: ABdhPJx1btLLTBXEFgpXDPhTCJScji/umzB55h96FNh8lq7mlIt4d/IQDK9YMn2EtbU9mBvwLvrqGg== X-Received: by 2002:a17:902:ab94:b0:143:beb5:b6a7 with SMTP id f20-20020a170902ab9400b00143beb5b6a7mr36447789plr.30.1637894860877; Thu, 25 Nov 2021 18:47:40 -0800 (PST) Received: from localhost.localdomain ([103.99.179.247]) by smtp.gmail.com with ESMTPSA id k14sm4814513pff.6.2021.11.25.18.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 18:47:40 -0800 (PST) From: Calvin Zhang To: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Rob Herring , Frank Rowand , Catalin Marinas , Andrew Morton Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Calvin Zhang Subject: [PATCH] mm: kmemleak: Ignore kmemleak scanning on CMA regions Date: Fri, 26 Nov 2021 10:47:11 +0800 Message-Id: <20211126024711.54937-1-calvinzhang.cool@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 0A17FF0001D5 X-Stat-Signature: 1nqsftqmu3j64j1fp9jcpzud4ec6tdya Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=G2bPd47m; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of calvinzhang.cool@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=calvinzhang.cool@gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1637894861-293050 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Just like this: commit 620951e27457 ("mm/cma: make kmemleak ignore CMA regions"). Add kmemleak_ignore_phys() for CMA created from of reserved node. Signed-off-by: Calvin Zhang --- kernel/dma/contiguous.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 3d63d91cba5c..66bd9a59615e 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -50,6 +50,7 @@ #include #include #include +#include #ifdef CONFIG_CMA_SIZE_MBYTES #define CMA_SIZE_MBYTES CONFIG_CMA_SIZE_MBYTES @@ -426,6 +427,9 @@ static int __init rmem_cma_setup(struct reserved_mem *rmem) pr_err("Reserved memory: unable to setup CMA region\n"); return err; } + + kmemleak_ignore_phys(rmem->base); + /* Architecture specific contiguous memory fixup. */ dma_contiguous_early_fixup(rmem->base, rmem->size);