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 B3389C43334 for ; Tue, 12 Jul 2022 11:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232303AbiGLK76 (ORCPT ); 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: 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