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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F2ADEB64D9 for ; Tue, 4 Jul 2023 16:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbjGDQ36 (ORCPT ); Tue, 4 Jul 2023 12:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231486AbjGDQ35 (ORCPT ); Tue, 4 Jul 2023 12:29:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5500FE5; Tue, 4 Jul 2023 09:29:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DF82461122; Tue, 4 Jul 2023 16:29:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C845C433C7; Tue, 4 Jul 2023 16:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1688488195; bh=mz2Iu6lHIM5ltZlhnJknul78c5yuJ4JBfaMtDnONxio=; h=Date:To:From:Subject:From; b=0ZutxEr0r23OaYlZBdIZDrzyK1QmhqBC0pn9tnNRh5bZFFCk6AlUR7u5KFQ8/UoHs w7uZUWDt1uVoQ2kqgWcZc04onvIQG+KPSzna0ohSxhXwaEZnRZ6aMyLnNkv/Ow/zGJ 3gQdAYRnxLuYMbUEmvtbI/mIidk2cT9B0d1s730w= Date: Tue, 04 Jul 2023 09:29:54 -0700 To: mm-commits@vger.kernel.org, willy@infradead.org, stable@vger.kernel.org, songmuchun@bytedance.com, osalvador@suse.de, mike.kravetz@oracle.com, liushixin2@huawei.com, akpm@linux-foundation.org From: Andrew Morton Subject: + bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch added to mm-hotfixes-unstable branch Message-Id: <20230704162955.3C845C433C7@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page has been added to the -mm mm-hotfixes-unstable branch. Its filename is bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Liu Shixin Subject: bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page Date: Tue, 4 Jul 2023 18:19:42 +0800 commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") fix an overlaps existing problem of kmemleak. But the problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in this case, free_bootmem_page() will call free_reserved_page() directly. Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when HAVE_BOOTMEM_INFO_NODE is disabled. Link: https://lkml.kernel.org/r/20230704101942.2819426-1-liushixin2@huawei.com Fixes: f41f2ed43ca5 ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page") Signed-off-by: Liu Shixin Acked-by: Muchun Song Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton --- include/linux/bootmem_info.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/bootmem_info.h~bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page +++ a/include/linux/bootmem_info.h @@ -3,6 +3,7 @@ #define __LINUX_BOOTMEM_INFO_H #include +#include /* * Types for free bootmem stored in page->lru.next. These have to be in @@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsi static inline void free_bootmem_page(struct page *page) { + kmemleak_free_part(page_to_virt(page), PAGE_SIZE); free_reserved_page(page); } #endif _ Patches currently in -mm which might be from liushixin2@huawei.com are bootmem-remove-the-vmemmap-pages-from-kmemleak-in-free_bootmem_page.patch