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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D999AC433EF for ; Tue, 12 Jul 2022 10:59:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6045A94005F; Tue, 12 Jul 2022 06:59:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B2D494005D; Tue, 12 Jul 2022 06:59:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A05B94005F; Tue, 12 Jul 2022 06:59:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3D99994005D for ; Tue, 12 Jul 2022 06:59:58 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 126F284A for ; Tue, 12 Jul 2022 10:59:58 +0000 (UTC) X-FDA: 79678152876.24.76C8A0F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 64D66C009C for ; Tue, 12 Jul 2022 10:59:56 +0000 (UTC) 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 A8FA8B817DB; 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: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657623596; a=rsa-sha256; cv=none; b=kiFZoX0rC4ieRFXOPaJa6ixo04c2qiNcugFoSUVLByB3m3YLqFuqCLqHqxfSt2r/rdGb7U gW7dhaas4j9dZG0yN/TIFV0mJGHa5w8H66giTpG8QOdcvwP2+Hrc2OWEteFoFUxy9o7Md5 xS5+rFjEomN9QqlICzYCX+tws62whYw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf10.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657623596; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DwZFHDa3lfT9D6I1R3JXOncujVqx6dv+UdQMxyf7W58=; b=qR9kjyJOlez/6G5lwMRcCbSa8kKEcvqCSUkvvI5NqP2WVq79rzQ9PTkHUiiKuuD6DSgNCW z1cSxS2wXpKpd2OzR7IB8gDmkvpDVejC6UyhqY4WjK8RZm9guxAQ7I7hGrhodvUND9UibZ yldrh/gipb9j6ZfBiUXOUdnakMi8kNA= Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf10.hostedemail.com: domain of cmarinas@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-Stat-Signature: ck9yby9trcz1174x6yazukg3x4gstw3z X-Rspamd-Queue-Id: 64D66C009C X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1657623596-473582 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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