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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A30E1C433F5 for ; Thu, 25 Nov 2021 17:18:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EC4A6B0074; Thu, 25 Nov 2021 12:18:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09C6D6B0075; Thu, 25 Nov 2021 12:18:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECCAE6B0078; Thu, 25 Nov 2021 12:18:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id D9B3C6B0074 for ; Thu, 25 Nov 2021 12:18:09 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7952218565643 for ; Thu, 25 Nov 2021 17:17:59 +0000 (UTC) X-FDA: 78848110320.10.B996929 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP id 76C9C700009E for ; Thu, 25 Nov 2021 17:17:57 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 45FDE61059; Thu, 25 Nov 2021 17:17:56 +0000 (UTC) Date: Thu, 25 Nov 2021 17:17:53 +0000 From: Catalin Marinas To: Calvin Zhang Cc: Rob Herring , Frank Rowand , Andrew Morton , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: kmemleak: alloc gray object for reserved region with direct map. Message-ID: References: <20211123090641.3654006-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211123090641.3654006-1-calvinzhang.cool@gmail.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 76C9C700009E X-Stat-Signature: de9najssxuth9aha7inox51nar6bqh57 Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of cmarinas@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) X-HE-Tag: 1637860677-687759 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 23, 2021 at 05:06:41PM +0800, Calvin Zhang wrote: > Reserved regions with direct mapping may contain references to other > regions. CMA region with fixed location is reserved without creating > kmemleak_object for it. > > So add them as gray kmemleak objects. Do you get any kmemleak false positives without this patch? It would be good to include them in the commit message. Without seeing a false positive caused by this, I'm not convinced it is the right approach. You mentioned CMA but telling kmemleak about the whole CMA region is a pretty big hammer. I'd rather add individual kmemleak_alloc_*() calls in cma_alloc(). -- Catalin