Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3049925rwe; Mon, 29 Aug 2022 05:09:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR6pgGeoRCORML3rlhpbBzETSx40khPjcsUMm4SQIVKw4/79VZSE18DSbQmQWke9nH7jjj5r X-Received: by 2002:a05:6402:4305:b0:448:5b80:757a with SMTP id m5-20020a056402430500b004485b80757amr5304285edc.198.1661774947889; Mon, 29 Aug 2022 05:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661774947; cv=none; d=google.com; s=arc-20160816; b=hsz7dflUfS20Z+s8KkC0ii6Qdkc6DaYnIY12G6bOcR0+GeG6bqjb38mWpbfqqlWMsD zILKjwTOneW6KgpgPcaR5HOnMzRQj+pfmCMtlSfyrbhGoqDeHzyqjj8F9NlNYXzDD3Id QT656zHvUt6hGvyFtFzinAuXrLNbTBG/NN8ip3zxjQs1tqB3ps9OecSIMsuCfLhEBfrs FUcVjszvw27rgSV1N/DLV9dwbDrBXVZf8xDtPHjDbASSXN/vBx9XWS4aO5HoZy3tPt+P 7YZMlxkuWEDWLcpzP3V4aIqh99OT9ZbEto84S79an2fN6nsasdar9YtNiakAJ8u4RSp1 N7yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9o3aFtrua1bY9WO7lP7sLujXHXXwKXKEwtyDkjxwH4Y=; b=e1j0k9vCKv3JXF2N9lbm1l9tdXlreXBMRzJvdNfDWavI4r/ZYZprcfR1tsvT/ljabA qin2qD2MKusxst9esVWNKaJ0QEbKSq+DCldIUGUllewzytCUuANWdanB+sKwm3ADQ3PR +QOSqU5Ni0YkJTx0JCOOUVtNyDW0dyTwJ1hUcBEFwblwfhoanlg2tsERot55gA2HR8Om ACxFsXGckrd6ajASEFDXzfdOH9lOTm0wSE2AwKnoNwZ2Y2x4ZMSw+6r3bVOOvMrk9MrD NjtXaJHkSbogmRgO0SrgMoey4qF5o2mGp/F2TQUbyk7zwAnRerf545b+LqbV/E6q97Gj ofTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nGzykrWL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr38-20020a1709073fa600b0072b68ed1a49si3734770ejc.870.2022.08.29.05.08.42; Mon, 29 Aug 2022 05:09:07 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nGzykrWL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232548AbiH2LdL (ORCPT + 99 others); Mon, 29 Aug 2022 07:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbiH2LaQ (ORCPT ); Mon, 29 Aug 2022 07:30:16 -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 296E97B787; Mon, 29 Aug 2022 04:18:21 -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 D3A32B80F1A; Mon, 29 Aug 2022 11:18:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D412C433C1; Mon, 29 Aug 2022 11:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771896; bh=mMH1hGcKpgwXBpSgbGBaRQI8Dz/52lPkbKB04R3cWOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nGzykrWL7TvRTYIjG8ONB+YazrUqlBuQMlcXTiuwM3oVjMVJlPXv7asr18LzQT7IC Z+4wehicc5/wkN6QfZM0iripm3yiv1WhKUx7BYlHUx+/ZF/cbGQ2MPTKftBDUVtGeG y7oOais/pH9ItR26KmxbO2dAjwMg/8IGT0DVa2VU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Shixin , Muchun Song , Matthew Wilcox , Mike Kravetz , Oscar Salvador , Andrew Morton Subject: [PATCH 5.19 116/158] bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem Date: Mon, 29 Aug 2022 12:59:26 +0200 Message-Id: <20220829105813.970168702@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 From: Liu Shixin commit dd0ff4d12dd284c334f7e9b07f8f335af856ac78 upstream. The vmemmap pages is marked by kmemleak when allocated from memblock. Remove it from kmemleak when freeing the page. Otherwise, when we reuse the page, kmemleak may report such an error and then stop working. kmemleak: Cannot insert 0xffff98fb6eab3d40 into the object search tree (overlaps existing) kmemleak: Kernel memory leak detector disabled kmemleak: Object 0xffff98fb6be00000 (size 335544320): kmemleak: comm "swapper", pid 0, jiffies 4294892296 kmemleak: min_count = 0 kmemleak: count = 0 kmemleak: flags = 0x1 kmemleak: checksum = 0 kmemleak: backtrace: Link: https://lkml.kernel.org/r/20220819094005.2928241-1-liushixin2@huawei.com Fixes: f41f2ed43ca5 (mm: hugetlb: free the vmemmap pages associated with each HugeTLB page) Signed-off-by: Liu Shixin Reviewed-by: Muchun Song Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/bootmem_info.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/bootmem_info.c +++ b/mm/bootmem_info.c @@ -12,6 +12,7 @@ #include #include #include +#include void get_page_bootmem(unsigned long info, struct page *page, unsigned long type) { @@ -33,6 +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); free_reserved_page(page); } }