From patchwork Sun Oct 8 02:33:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13412515 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 2A37FE95A87 for ; Sun, 8 Oct 2023 01:33:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 911D68D0017; Sat, 7 Oct 2023 21:33:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E7AF8D0001; Sat, 7 Oct 2023 21:33:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D93C8D0017; Sat, 7 Oct 2023 21:33:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6DA2C8D0001 for ; Sat, 7 Oct 2023 21:33:27 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 409DD802FA for ; Sun, 8 Oct 2023 01:33:27 +0000 (UTC) X-FDA: 81320571654.18.3C7532B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf06.hostedemail.com (Postfix) with ESMTP id 0BE7D180009 for ; Sun, 8 Oct 2023 01:33:23 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696728805; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D3ZK2F+1B7hk/Ob5LKYTaMLtCgj+8CCYSXooVfHp9ZI=; b=HN6B5wl/3qeWwayONoMqYAkTeCbpPf9yGGBmKaaUm69CrP0CB7k6NlWGBq9ikj9ExX2XCL RVo7K3wSCQfR5//ok4cAMDhIckigE9Xj+D3xEuxAmgIrAnCBtUI/KFscE/yxfkaODHsJTD YO1Tp/Ytb1hbwTmwjgt5G/OEpvl7/oU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696728805; a=rsa-sha256; cv=none; b=6+VMg4VhhkDeZoK57b8GvWnCyzIdxg+ny5aC8ZmkCKF0vuSurux6LpXsBOwZMSA2W014sU 3bqVZlPh/whlRYr+8QpFscvy4NJyPBSj6kUTr3lMC90R1Q1pOqnren7rN92lduPfCmb9Xb 6R54DtlEJk7ruECTW3V+GN6VXa4d5gg= Received: from dggpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S34Lh2dH9ztTD8; Sun, 8 Oct 2023 09:28:44 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sun, 8 Oct 2023 09:33:17 +0800 From: Liu Shixin To: Catalin Marinas , Patrick Wang , Andrew Morton CC: , , Liu Shixin Subject: [PATCH v2 1/4] bootmem: use kmemleak_free_part_phys in put_page_bootmem Date: Sun, 8 Oct 2023 10:33:14 +0800 Message-ID: <20231008023317.3015699-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231008023317.3015699-1-liushixin2@huawei.com> References: <20231008023317.3015699-1-liushixin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 0BE7D180009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: qjibgeoewhf1wmuf3nxwtbyeydxquxk5 X-HE-Tag: 1696728803-872557 X-HE-Meta: U2FsdGVkX1+385esU36RwuepxZDSwUFzUCAJ5sLMQvKr70OjkFqTDc4lwPgUgvnc7yhI89ryqMrSdQUJpmogM/6KLHxXosTzib4cLK/LLWWph+WD30tURDePMUD97Ls0uBBVERg6ySt8mCK4lx/oVpqzK89Q4Pm8ZDeDjMl9EFTXm+6mYFgr3wD68tgjy/xf8e6YnpkueUHmpmSWiCTYzlOuSn8TWfa1YgxlVTWGXiIEXRyFKvai8l8ambWkXjWpXvUKIwPVkqLC7LXxzUmEors/ui3NUCedZ+IZAZl01YkO6Uuscdhoy6aK4jOdzsEWX4PrhMm9MEGZKY7EOLuf2JkqRnsbsZgkrQri+LCrQz8Vdwn+v8uQvbbrJdTMpsRta9AR/oatFL8GsY25ONG6KNDAJfmHN8O/0mIcFzK5gXEpAdhZbQOSncqrfyaw4sLAq3vUO649j13WuqLEuHlGZAx68TQSZfLPoSnQOIKBC9qpwmMelaXgPpY/Ab1RoUowzZZxuGzXlPfY7af1oKMrQ99MTw2t53SjqDsCzTQEIZJE81qpzQHN4NULXKvfcEmaqGJclbDCLRxymG7g8qlUC9D9YfWgoPwOTn7+z/InvvyT8SgJlGQ04f9StNeQjEk9LVlubSlntXskg0wO4WWD/EHlpTfKbErcO2Q1Kcz+59A13hz0++CtSlmBUW7NKpcmU6MKPQhnTWNL/JiFzRpG/dj+NBMXogvkQU6+qbg+BlQJgPK8pr5slACn6bGNSr31DvARY6to0IHQ0aJf3pRTcWLFYO5jrlMW4xw/45feSb0dWNPXVkMkCsJUT6oAlBeBUvoPcBFbqEAPsn89ZZmSOAmGWYQQ6Zcyh52zMo1f4uLQZzNF0APbwYd+o05y1dx6xq5CrhmqTkwHw4/Stj8dCHfRUv2ZRL7YVx80mxi6Pz5ClKlldVbhD+kXWo81gBJ2EVfdxPyBbIjrODfriL2 irtwmd02 3QHygOdRrsK5Oqul+8t7GNwT00L0NvahMQHHD5onAIJ4Y1u54oGhAIaCSdE2vwMCbKRDCIK/tq2Ljz5i2LrzCtdNiGQxDRfPEn+Ac7H5Fc9kPfHcPmGthiyK+2sItpm2UxExwJb8/YF9gW+hBrK3LbNNF3xRamJTZp2c7jhoAGXcjrWEgj2irRI19TLr+NmmKkohPgt9CJ1GCnI+NHXw/aTfC2LkKTL4Shs5vzWqWICGY8snY8B6an+8njRkoqH8Zk/emf6KbCcjYIykopxZlvbJCTHYn7N29e9Q6jHEkJF/Qp7agyhCBGn5PykqdlF2DwgNoDdWlrk9RwzoZriHNI8dmlh4GOwU8GzT+xK6OYpWK0gouhTou5eOTnQmXbFVCekPl/DwOAQgtIuibQn+UB7hNrnYKIS0nKTPI 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: Since kmemleak_alloc_phys() rather than kmemleak_alloc() was called from memblock_alloc_range_nid(), kmemleak_free_part_phys() should be used to delete kmemleak object in put_page_bootmem(). In debug mode, there are following warning: kmemleak: Partially freeing unknown object at 0xffff97345aff7000 (size 4096) Fixes: dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") Signed-off-by: Liu Shixin Acked-by: Catalin Marinas --- mm/bootmem_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/bootmem_info.c b/mm/bootmem_info.c index b1efebfcf94b..fa7cb0c87c03 100644 --- a/mm/bootmem_info.c +++ b/mm/bootmem_info.c @@ -34,7 +34,7 @@ void put_page_bootmem(struct page *page) ClearPagePrivate(page); set_page_private(page, 0); INIT_LIST_HEAD(&page->lru); - kmemleak_free_part(page_to_virt(page), PAGE_SIZE); + kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE); free_reserved_page(page); } }