From patchwork Sun Oct 8 02:33:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Shixin X-Patchwork-Id: 13412518 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 63DF5E95A86 for ; Sun, 8 Oct 2023 01:33:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 010AC8D001A; Sat, 7 Oct 2023 21:33:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F02FF8D0001; Sat, 7 Oct 2023 21:33:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFB028D001A; Sat, 7 Oct 2023 21:33:39 -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 CF7EA8D0001 for ; Sat, 7 Oct 2023 21:33:39 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9C8051A02E5 for ; Sun, 8 Oct 2023 01:33:39 +0000 (UTC) X-FDA: 81320572158.15.FE15B1E Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf24.hostedemail.com (Postfix) with ESMTP id 61333180011 for ; Sun, 8 Oct 2023 01:33:37 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696728817; 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=uxAR8iPpyzK1PAA01I33pQ2SqFi5A2TOT/zKa9EjxMQ=; b=NNHbTyOqo8hVNHmQXNj9P0YYSwRUlEaLPecCt3bQ9XPMDV32O/cGJF5907ic7oxUASwcDF LHrCndKtIzbLRtYrzo22yLxjkah6j6BhkjhZtPlqj2J4TO0ioI+lKrA5KGklT93p5ZCda5 FCmVWXxmR7efDmfptjA5gyk7HkAlq70= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696728818; a=rsa-sha256; cv=none; b=igc/UDp7oID8Qo+BvyzkC9OicF192c4zGKP3KwW8+XUqFzsPev0+jnCnqbVDYlfAuxdxPQ mN7xnCj8Ls5XkqExPl36Ejo50+5geBynkkRuSZVYll4iFi0wYNegnTtvlimHz570J/+Aj7 qsR0HaNelATg3lWNs1pY3/y6rcKGheU= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of liushixin2@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=liushixin2@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S34P42l2WzrTFk; Sun, 8 Oct 2023 09:30:48 +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 2/4] bootmem: use kmemleak_free_part_phys in free_bootmem_page Date: Sun, 8 Oct 2023 10:33:15 +0800 Message-ID: <20231008023317.3015699-3-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-Stat-Signature: x54yox6b81ux7f4u78fuwqa854s5i567 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 61333180011 X-Rspam-User: X-HE-Tag: 1696728816-366248 X-HE-Meta: U2FsdGVkX1/oHVpDkti/m34HZNmjfHG57Ws5Jrepz40jfZaqruoZY94/M0avRPxlBioiX/M47MLl+tBqeDvrj8lWRBPE2lu5XlNtyiiq4Ql92jnwGAHu24i4W4JQSK4vhgYXXG8uAiQgd1pURGzRxk2SI3k2ni2dWulL1BMVoYnat6UDxWc30vIsB5q0rEzckEuuVy+hie/yfX2RPcNC0MH2S9H4i7RBTemz9a+XiaQPpmW2P4xHR2fPUuVvGhrGQ+SB4pKSWIWvu17t1orK5xt2sVK08DGyEjuNvWwtKNWYC3VWdKeWj2oqzjokbXXOEZD09ko+y9wQnR9GM2vSBbWAzY5TtO6YAWB5sWeKxEkuoNrs3g1hPdE8/UxpFacE4dRUkXgDEDX4et9TcL1IACmW+vgqLRKijw3FCs8cOD6BJmIbYxKJtvnaNy597YinWzh0Y0/dmfS6PFUe+8VlGlPxV3MW+5bXi0WeTHj5q0yOmJ1DLIaBsv42y+JK7frJEmO28BoFVsraXS3iK/tCTYzDDOI4d21dYuZyeTUhzJ5kdm5l8bvqNrRYWK6B5+oSZ1UaRcMmkXBGWiF8DBAGEzjiTlZ/KxwDTRzsAe9v5+uOr8U7EK9byaJ0SAJsrhwBxBwsgPA6k5TlHvWLrVj1gl91B21w5qFEp/m00gpXKhiNWOIHZjTm4+pLhY2/y1qEOwCgtVThotXRrhKauA6nYICqOLjwvXsznNAsCTO/V3KQf6jlxUTe9JT0EqUwNVq9zczNBCXsBrvW5dCHaU8/ozJ+IrN2iuTyq4Qd5YwfXLazDhJ6cbBPqsCRrY70Pc1pt/+vJAyHchC8872N612nPqXewRLyOn5zEyS9SgOkncV8qynCDImhD1dfa0Iuz0KpAk3Gq7NCh4Kylg95C2mQd+vM2oAco2GDAb/HaDq8RSJQTcAG+MqNgzeVSEzj2k9SnkxwMvnT2WzvBjX2d5W 8BN6u1cE wBK46trE8VFNZiuKwwHxq9XFw5Ghsp4mE6SzL8PJEJ7Zc846cPVScF2xaaGm6GHESSMDKiqJO2pUwmTHRneGe/4KcyaKlm8CrqmgCPsJr8Waz3Pqv7VMcZYDd+Ytk9o68D3LMsQGsHjbPO5KlaQO7oFh3dhCkYetJkuuTYcGrPTuaKXf5olBPEvL7v4ehyCCzYKsLuaiLBLUiWx4KCdvWSb0Er4gLMC4khDi9Ml+0xBjFnVtnpI7dAyzt3vYCEQyNRWM1wLMmgOww3h1ZD/ZTLFnOe4w73VTneUJllLIL8UPuYkO6DjRVSlZShYNLHmqQR6xBWTHSldtUHBRfJlMKIn9g9u/2vdhs6dBb3ni0VLNQ7OYEla9eqbD2cvQ87iSNld18jP7OWw1EUHDY20XdBrDHgCEv4fBt3hn5 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 free_bootmem_page(). In debug mode, there are following warning: kmemleak: Partially freeing unknown object at 0xffff97345aff7000 (size 4096) Fixes: 028725e73375 ("bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page") Signed-off-by: Liu Shixin Acked-by: Catalin Marinas --- include/linux/bootmem_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bootmem_info.h b/include/linux/bootmem_info.h index e1a3c9c9754c..cffa38a73618 100644 --- a/include/linux/bootmem_info.h +++ b/include/linux/bootmem_info.h @@ -60,7 +60,7 @@ static inline void get_page_bootmem(unsigned long info, struct page *page, static inline void free_bootmem_page(struct page *page) { - 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); } #endif