Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp251252iog; Fri, 24 Jun 2022 03:22:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uVpgfKn6fshtQ0uR6Rt59+BQSVmrl1N3gazLxla45jvQV6AsF1B0HHD5DQYagRZ9/uBVvl X-Received: by 2002:a17:90a:450c:b0:1ea:a6b8:7601 with SMTP id u12-20020a17090a450c00b001eaa6b87601mr3114903pjg.205.1656066159105; Fri, 24 Jun 2022 03:22:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656066159; cv=none; d=google.com; s=arc-20160816; b=r8XdzxQmmkrhoK6mSfqMSpUhRmejIprAX5mkuizwkvt+KDcjvsDefWx9EnXtodf/vH 6oLXm1PxU+53tA/tkT6YIWnHTFNrDm9yHaU//xd7gle52D/w46bHMamqrKx2O+M9oknh mlr7liou+HXg2f2bb1B92QS55TZBt4XL0BhXeL42nEE8zETgYNWFCgSFVYVrL3qlWEH8 tZoHjtaMY4IxnOhYqSYw2U9dlSdkkc6LA3zH5DAwABpOV39Xah+8dFbRxhoWM4/w2PJh YUv9USSoI2/81aoswOACjtS7WKSWJtNfggUy/G8HbvfXquo0+J14f1lsQV65b+RmZsrC R0xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cfgTxXo5cZ1ix+HJgpn1u2Kbl8sei9D90tg0/aWfAzY=; b=F+ORzfbEEFdiQ5md+2CAJvkj4lOfpxWYOcryIvQsJQ/C3fwpsK509ry+rrtpPnFclM v82/X8kA4pTY5+R6E9JqEedjWkT5LRLk/ArH2EgaSylIyL/zfctxJ4PQgurdujqhXCl/ YkDWJqYRm8V2WWxncDRz8Goza6+Qysxon3NF0seR4HtTtQFbDP+jvNw1la6SamzISs9O Jd7QoWff6tLn8/hX8II1vdA7j/mMJU3uUc/fkHFKcyWhNNr/Gn4lJxsONACk7HuAE8wS 4k1kkVxzohMcwrBvycVHBUUpdC+wKHuH8r8+SutMk6ghRrHjP3mm+nwlDc+SLsW9XdVc TKMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h64-20020a625343000000b0051b3a927ad4si1852579pfb.289.2022.06.24.03.22.26; Fri, 24 Jun 2022 03:22:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbiFXKSz (ORCPT + 99 others); Fri, 24 Jun 2022 06:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiFXKSw (ORCPT ); Fri, 24 Jun 2022 06:18:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D8F44DF6E for ; Fri, 24 Jun 2022 03:18:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C4360B827F9 for ; Fri, 24 Jun 2022 10:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B0B7C34114; Fri, 24 Jun 2022 10:18:47 +0000 (UTC) Date: Fri, 24 Jun 2022 11:18:43 +0100 From: Catalin Marinas To: Yee Lee Cc: Patrick Wang , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Marco Elver Subject: Re: [PATCH v4 3/4] mm: kmemleak: add rbtree and store physical address for objects allocated with PA Message-ID: References: <20220611035551.1823303-1-patrick.wang.shcn@gmail.com> <20220611035551.1823303-4-patrick.wang.shcn@gmail.com> <09d9066b3e55966c108670219711482791d38880.camel@mediatek.com> <10660122efb538669144e4c46558b83400125d79.camel@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10660122efb538669144e4c46558b83400125d79.camel@mediatek.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2022 at 07:25:15PM +0800, Yee Lee wrote: > On Thu, 2022-06-23 at 16:45 +0800, Yee Lee wrote: > > Now we have seperated rb_tree for phys and virts addresses. But why > > can't we have kmemleak_free_phys()? It may apply the same format to > > delete_object_full(). > > > > Some users would request to remove the kmemleak object from the phys > > tree but we don't have this one. > > Please check this, an issue happened at kfence with the latest kmemleak > patches. kfence pool allocated memory from memblock but have no way to > free it from the phys tree. > https://lkml.org/lkml/2022/6/23/486 I don't think I was cc'ed on the other thread but at a quick look, what you probably want is: kmemleak_ignore_phys(__kfence_pool); instead of the current kmemleak_free(). With Patrick's changes, you can no longer tell kmemleak about an object with a physical address and free it with the virtual one. -- Catalin