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 87057C433F5 for ; Fri, 26 Nov 2021 01:36:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 065946B0078; Thu, 25 Nov 2021 20:35:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F2F6C6B007B; Thu, 25 Nov 2021 20:35:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD12C6B007D; Thu, 25 Nov 2021 20:35:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id CACC56B0078 for ; Thu, 25 Nov 2021 20:35:52 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 97AFB89958 for ; Fri, 26 Nov 2021 01:35:42 +0000 (UTC) X-FDA: 78849364524.22.4A0EDA4 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by imf07.hostedemail.com (Postfix) with ESMTP id A360010002CF for ; Fri, 26 Nov 2021 01:35:38 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id 71so6670802pgb.4 for ; Thu, 25 Nov 2021 17:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BC6SGqll2uc/Zv/S1kgQ3STL+1ZHDPjKpDU0asoxWCM=; b=TnDzylDFZtfPCO+3RZNOIlB4jX60ZxezOab4G01BceqytfGO0wR2P54JICIVdeIPXa qCU3gY7aynOiJuPmybr/4VnDE7oHFSktcMjW0hg0k5cngqDeBCi10XOJCEtITFk/Y1uy jl33CWtTi2Ek1Y760ObcfgxljT14/crK2Q4J33MpAvRo9ccy9sM97vIkXEf6P5jTOEyT n7o4Idjsf4x1a3m0MDtEIX2/lHosYXN8lbXU0gSbhPeqEsoA2SI9JwXsMgRn0mzjph7D gU8NwYofoEYaaNIcV5fiH6q7XkJa+7o9F75Y6255tUplTCGVy82OiE+Hd2T1hZwjU1o1 rEcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BC6SGqll2uc/Zv/S1kgQ3STL+1ZHDPjKpDU0asoxWCM=; b=zJDCPwbqn1w3/DdxUbWBZA+cv89iUanqWy+/xHBS+yab43nbBAiZ8+tlDsXwrXlEMV TfXlicMkzPCq5Zcg9crN/tSE1i/MsUUKxrSQl7IjnQhjdJk3T/SyTQUu8BatfXivKjhO TXBNfD3mbtfeeWrCDNcBMCSIZx0P0xGws/Fpm7hKkeXlKw8jtBiY4s1sUF9vtz5bJmup BgpJqqwNgzxp+4rOI/xG1EGfxLOg2gbTs1t18qqB8XATkycrfavmKDExY1NllvvDM0HD SFt/A8fncEapN16+g4mO48D0tJYKsQOrzLxHcHOlebjrsdGKpgwy28EzsP+7Nkheys+s u+Kg== X-Gm-Message-State: AOAM530hrfYaZBiHiFkbVhjhf7Lvw4AzOOqonVeEER6yRRVokRROtYkR HGGv3BElhNWdJ0EZwUbaJWM= X-Google-Smtp-Source: ABdhPJxxhoRPWvSi7qP2HqlGcwQFPXdVX9wsMvQJG2frSrOtm2O9eiZy7JM9XwabCs3MJc/F9lkLkw== X-Received: by 2002:a63:145d:: with SMTP id 29mr18972313pgu.264.1637890541142; Thu, 25 Nov 2021 17:35:41 -0800 (PST) Received: from localhost ([103.99.179.247]) by smtp.gmail.com with ESMTPSA id d10sm4772832pfl.139.2021.11.25.17.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 17:35:40 -0800 (PST) Date: Fri, 26 Nov 2021 09:35:36 +0800 From: Calvin Zhang To: Catalin Marinas 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: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A360010002CF X-Stat-Signature: eewzonmptfhja6h1hdywij7wmynsyf4o Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TnDzylDF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of calvinzhang.cool@gmail.com designates 209.85.215.174 as permitted sender) smtp.mailfrom=calvinzhang.cool@gmail.com X-HE-Tag: 1637890538-343679 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000934, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Nov 25, 2021 at 05:17:53PM +0000, Catalin Marinas wrote: >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. Sorry, no. I thought it was possible before I saw this commit: 620951e27457 ("mm/cma: make kmemleak ignore CMA regions"). > >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(). Yeah, I agree. -- Calvin