Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4217358imw; Tue, 12 Jul 2022 04:14:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vGvIHxszj+5rwqbjc7Rsmo9AgQuF5kY0yBFjnQeKRUr5VGQH55M7x+TQ3r+uQrP1uclZ14 X-Received: by 2002:a65:6d0c:0:b0:412:6da1:df6b with SMTP id bf12-20020a656d0c000000b004126da1df6bmr19964061pgb.14.1657624473122; Tue, 12 Jul 2022 04:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657624473; cv=none; d=google.com; s=arc-20160816; b=PD46gmxyN9p+gnnNad8+uyCLSufFHD0wAqzaTKmkuWrV90aD6OQ1cafVOi5XQI3M6i QLEZb+mdZebeAag6zsAccG1l/IotmmM5rJGyZ69oQ4HpOi6wsCuTsHvPi77My2mj3Di0 w5+WP2wzQ7T1FBljQEPdmwzPUMG8x9CpeM7IQort6LFwa2zg+CJJvh2VSnx9As5maMWy 7zDtx7zp3LcYPFTc1AZQOXCAQw34HwXXyvP0RdrU/kmvd1R4/a9O7PGQqnibuyr1ypyx uHaIxh0OBzyPPDjBfI0Ya2KMWZpxIcP0mp3uN3zhA1vvVEvnJBuC05SZOfUTIkhSziKE Hd9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DwZFHDa3lfT9D6I1R3JXOncujVqx6dv+UdQMxyf7W58=; b=yl094LCbG0VgDtXELVWr4MGpyATxZl2z45uhu3P5UM21ueOVZH/LOcsrfvIrE+LffK rPmiRTzxBy+fUTDCfpvM7M0rh06iS39yVjwdKagyUfCL4/ol9jA3WNLh34mfl4YLCnF/ wgzOg1v3muZO66dLwQCCAfeH6bDnV5QdM1sClzz8jQlcdCo3lRUExr8gS2cm/Sv6T0MW jBmLrT1QwMj21jvOFrpXuf9GmM1ziPU9Ay/JVDhmDb0FVUWI1OOwvPKXuqLk33q0J2uk 9SOKm3xSzmtvdPKAXtqqDcmx03DcUc8vo+4cz78LDQS8tmUkDUrdFWTyIFB1N8yBBqbh 6r+g== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j63-20020a638042000000b00419699fdc27si1248500pgd.709.2022.07.12.04.14.10; Tue, 12 Jul 2022 04:14:33 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbiGLK76 (ORCPT + 99 others); Tue, 12 Jul 2022 06:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiGLK75 (ORCPT ); Tue, 12 Jul 2022 06:59:57 -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 438C1EE30 for ; Tue, 12 Jul 2022 03:59:56 -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 B79DAB817DD for ; Tue, 12 Jul 2022 10:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E43BDC3411C; Tue, 12 Jul 2022 10:59:51 +0000 (UTC) Date: Tue, 12 Jul 2022 11:59:48 +0100 From: Catalin Marinas To: patrick wang Cc: Andrew Morton , dennis@kernel.org, tj@kernel.org, cl@linux.com, "open list:MEMORY MANAGEMENT" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: percpu: use kmemleak_ignore_phys() instead of kmemleak_free() Message-ID: References: <20220705113158.127600-1-patrick.wang.shcn@gmail.com> <20220705142000.4679acaaf1238a73a555ea58@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 On Wed, Jul 06, 2022 at 10:44:11PM +0800, patrick wang wrote: > On Wed, Jul 6, 2022 at 5:20 AM Andrew Morton wrote: > > > > On Tue, 5 Jul 2022 19:31:58 +0800 Patrick Wang wrote: > > > > > Kmemleak recently added a rbtree to store the objects > > > allocted with physical address. Those objects can't be > > > freed with kmemleak_free(). Use kmemleak_ignore_phys() > > > instead of kmemleak_free() for those objects. > > > > Thanks. What are the user-visible runtime effects of this? > > According to the comments, percpu allocations are tracked > by kmemleak separately. Kmemleak_free() was used to avoid > the unnecessary tracking. If kmemleak_free() fails, those > objects would be scanned by kmemleak, which is unnecessary > but shouldn't lead to other effects. > > I didn't observe any anomaly without this commit on riscv > and arm64. What could happen is an increased rate of false negatives as it scans more than necessary. > > And are we able to identify a commit for the Fixes: line? > > 0c24e061196c (mm: kmemleak: add rbtree and store physical > address for objects allocated with PA) > Current in mm-stable. I think we could add a Fixes line for the above. For the patch: Reviewed-by: Catalin Marinas