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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA16EC433EF for ; Fri, 5 Nov 2021 10:08:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 553566126A for ; Fri, 5 Nov 2021 10:08:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 553566126A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C814F6B006C; Fri, 5 Nov 2021 06:08:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2FEC6B0071; Fri, 5 Nov 2021 06:08:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4526940007; Fri, 5 Nov 2021 06:08:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id A70FA6B006C for ; Fri, 5 Nov 2021 06:08:11 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 24CDA5C4C6 for ; Fri, 5 Nov 2021 10:08:11 +0000 (UTC) X-FDA: 78774451182.21.A307CE1 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id 20EA430000A9 for ; Fri, 5 Nov 2021 10:07:59 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 902CC611EE; Fri, 5 Nov 2021 10:08:08 +0000 (UTC) Date: Fri, 5 Nov 2021 10:08:05 +0000 From: Catalin Marinas To: Qian Cai Cc: Mike Rapoport , Will Deacon , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Track no early_pgtable_alloc() for kmemleak Message-ID: References: <20211104155623.11158-1-quic_qiancai@quicinc.com> <9bb6fe11-c10a-a373-9288-d44a5ba976fa@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bb6fe11-c10a-a373-9288-d44a5ba976fa@quicinc.com> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 20EA430000A9 X-Stat-Signature: cjrg1m54c7ksbw3oqtr8wqr1gjzoe55r Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of cmarinas@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) X-HE-Tag: 1636106879-459774 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 Thu, Nov 04, 2021 at 01:57:03PM -0400, Qian Cai wrote: > On 11/4/21 1:06 PM, Mike Rapoport wrote: > > I think I'll be better to rename MEMBLOCK_ALLOC_KASAN to, say, > > MEMBLOCK_ALLOC_NOKMEMLEAK and use that for both KASAN and page table cases. > > Okay, that would look a bit nicer. Or MEMBLOCK_ALLOC_ACCESSIBLE_NOLEAKTRACE to match SLAB_NOLEAKTRACE and also hint that it's accessible memory. > > But more generally, we are going to hit this again and again. > > Couldn't we add a memblock allocation as a mean to get more memory to > > kmemleak::mem_pool_alloc()? > > For the last 5 years, this is the second time I am ware of this kind of > issue just because of the 64KB->4KB switch on those servers, although I > agree it could happen again in the future due to some new debugging > features etc. I don't feel a strong need to rewrite it now though. Not > sure if Catalin saw things differently. Anyway, Mike, do you agree that > we could rewrite that separately in the future? I was talking to Mike on IRC last night and I think you still need a flag, otherwise you could get a recursive memblock -> kmemleak -> memblock call (that's why we have SLAB_NOLEAKTRACE). So for the time being, a new MEMBLOCK_* definition would do. I wonder whether we could actually use the bottom bits in the end/limit as actual flags so one can do (MEMBLOCK_ALLOC_ACCESSIBLE | MEMBLOCK_NOLEAKTRACE). But that could be for a separate clean-up. -- Catalin