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 C445CC433EF for ; Wed, 8 Jun 2022 02:50:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB93C6B0071; Tue, 7 Jun 2022 22:50:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E68546B0072; Tue, 7 Jun 2022 22:50:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2F996B0073; Tue, 7 Jun 2022 22:50:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C0EA26B0071 for ; Tue, 7 Jun 2022 22:50:41 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 939EB3574B for ; Wed, 8 Jun 2022 02:50:41 +0000 (UTC) X-FDA: 79553540682.13.ADCCA29 Received: from mailgw01.mediatek.com (mailgw01.mediatek.com [216.200.240.184]) by imf28.hostedemail.com (Postfix) with ESMTP id 9D6F7C002E for ; Wed, 8 Jun 2022 02:50:40 +0000 (UTC) X-UUID: 3e660db6f84544218ef19037371f5cdd-20220607 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.5,REQID:93a3f28d-808a-402f-a891-c803b67a2eb6,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:2a19b09,CLOUDID:f0fb8f7e-c8dc-403a-96e8-6237210dceee,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,QS:0,BEC:nil X-UUID: 3e660db6f84544218ef19037371f5cdd-20220607 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1643058563; Tue, 07 Jun 2022 19:50:33 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Jun 2022 19:46:08 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Jun 2022 10:46:07 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Wed, 8 Jun 2022 10:46:07 +0800 Message-ID: Subject: Re: [PATCH v2 0/4] mm: kmemleak: store objects allocated with physical address separately and check when scan From: Kuan-Ying Lee To: Patrick Wang , "catalin.marinas@arm.com" , "akpm@linux-foundation.org" CC: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Yee Lee =?UTF-8?Q?=28=E6=9D=8E=E5=BB=BA=E8=AA=BC=29?= , Date: Wed, 8 Jun 2022 10:46:07 +0800 In-Reply-To: <20220603035415.1243913-1-patrick.wang.shcn@gmail.com> References: <20220603035415.1243913-1-patrick.wang.shcn@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=mediatek.com; spf=pass (imf28.hostedemail.com: domain of kuan-ying.lee@mediatek.com designates 216.200.240.184 as permitted sender) smtp.mailfrom=kuan-ying.lee@mediatek.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 9D6F7C002E X-Stat-Signature: iks4xto5fyft4s5w9tr1ptedf54jc8hj X-HE-Tag: 1654656640-583298 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 2022-06-03 at 11:54 +0800, Patrick Wang wrote: > The kmemleak_*_phys() interface uses "min_low_pfn" and > "max_low_pfn" to check address. But on some architectures, > kmemleak_*_phys() is called before those two variables > initialized. The following steps will be taken: > > 1) Add OBJECT_PHYS flag and rbtree for the objects allocated > with physical address > 2) Store physical address in objects if allocated with OBJECT_PHYS > 3) Check the boundary when scan instead of in kmemleak_*_phys() > > This patch set will solve: > https://lore.kernel.org/r/20220527032504.30341-1-yee.lee@mediatek.com > https://lore.kernel.org/r/9dd08bb5-f39e-53d8-f88d-bec598a08c93@gmail.com Hi Patrick, If this patchset fix the above issue, I think we need to add the below fixes tag. Fixes: 23c2d497de21 ("mm: kmemleak: take a full lowmem check in kmemleak_*_phys()") Thanks. > > v1: > https://lore.kernel.org/r/20220531150823.1004101-1-patrick.wang.shcn@gmail.com > > v1->v2: > - add rbtree for the objects allocated with physical address > - store physical address in objects if allocated with OBJECT_PHYS > - check the upper object boundary as well and avoid duplicate check > > Patrick Wang (4): > mm: kmemleak: add OBJECT_PHYS flag for objects allocated with > physical > address > mm: kmemleak: add rbtree for objects allocated with physical > address > mm: kmemleak: handle address stored in object based on its type > mm: kmemleak: kmemleak_*_phys() set address type and check PA when > scan > > mm/kmemleak.c | 193 ++++++++++++++++++++++++++++++++-------------- > ---- > 1 file changed, 123 insertions(+), 70 deletions(-) > > -- > 2.25.1 > >