Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1363403rwb; Fri, 19 Aug 2022 02:14:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR516vtZ3P1RrjOCdI6WQSEsnAs0i3TxFiVVArAF6aCJ6fzRF2vNdDPlBqBCAIdfoxvAwefW X-Received: by 2002:a17:90b:3b85:b0:1f4:f76a:d5f6 with SMTP id pc5-20020a17090b3b8500b001f4f76ad5f6mr13134994pjb.156.1660900496612; Fri, 19 Aug 2022 02:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660900496; cv=none; d=google.com; s=arc-20160816; b=RZ61bwnlRYP6mYnrvUXLZCJLf04KrmC9xf103x/v7pvzOmAEYOp/PddpYAQdbMn6pz 6mmSOB3Zk0dCaYJ9TuIGV+kNq9CIvROGtVTGgPN2wIN9s8MmJmD3ebcnEdVkUFgfy7Cr f37O20aXOWO5I0LiXvQ3pqsYyqzbXvqW4nGs5RknSCoRDFTZnLrkD779kfJO76odzYDP aJK4dLy2DILah2BfLFGr6ZhvXqR7p1cvTCbP90XWUvzP1OTMS61ARB5yZLnoZvwYXmMo TaPb5aPWOSgZHmy2Op792Smuy8i+ZS6zp3y4z/aQ5YguFfnyjld0vOzDk1tUr1d0psu1 LpQg== 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 :message-id:date:subject:cc:to:from; bh=DcyWUgzzfvO6KnXW/9nH4kMvM5X3ul8quG7ldc23tJ0=; b=OHsG2SzYgLQb3o5ijHTNFmYhr7JOlV5f+bNNj+tqlvFBaaTuVeUWbZtHYDH1g4YzvV NJErjCxTNgMASU9aFpomEhourz0BVg62ZmFIe1TOG/ohUexjk0wF8UkpNGSleLz3xDOY VGcQD+Nkp77jZgw0w9O3OYjELVswdTEOYBmAmfxesdQqlHPowt9fT37DFDP43Y+a5jRm zV1FSGwBpbGSkJuK/Ijwh2nsuh9D92C5pDIH33Qkq6BXfWqRRQh6G7vN5lw7I8xHceV3 uTOt/ATQEGkDYm6cupUfSPVoTMntMRuy8iDotdrv88rYPUPldhjVruawCKAx3PXE8MfY WuBQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a170902c95000b0017275762141si1604747pla.355.2022.08.19.02.14.43; Fri, 19 Aug 2022 02:14:56 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347711AbiHSJFp (ORCPT + 99 others); Fri, 19 Aug 2022 05:05:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348014AbiHSJFk (ORCPT ); Fri, 19 Aug 2022 05:05:40 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0A77F23E7 for ; Fri, 19 Aug 2022 02:05:36 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4M8G3C4tRZzlWPm; Fri, 19 Aug 2022 17:01:59 +0800 (CST) Received: from dggpemm100009.china.huawei.com (7.185.36.113) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 19 Aug 2022 17:05:06 +0800 Received: from huawei.com (10.175.113.32) by dggpemm100009.china.huawei.com (7.185.36.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 19 Aug 2022 17:05:05 +0800 From: Liu Shixin To: Muchun Song , Matthew Wilcox , Mike Kravetz , Oscar Salvador , Andrew Morton CC: , , Liu Shixin Subject: [PATCH -next v2] bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem Date: Fri, 19 Aug 2022 17:40:05 +0800 Message-ID: <20220819094005.2928241-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100009.china.huawei.com (7.185.36.113) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 The vmemmap pages is marked by kmemleak when allocated from memblock. Remove it from kmemleak when free 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: Fixes: f41f2ed43ca5 (mm: hugetlb: free the vmemmap pages associated with each HugeTLB page) Signed-off-by: Liu Shixin --- mm/bootmem_info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/bootmem_info.c b/mm/bootmem_info.c index f18a631e7479..b1efebfcf94b 100644 --- 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); } } -- 2.25.1