Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2694932pxb; Fri, 5 Nov 2021 03:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycxiaQ5+PQVLgXx+7G+kYWXlbtZE+HKSQZDMDLhxsYaScAap1gvW02lgEqatnEHBUFTTtN X-Received: by 2002:a17:907:7209:: with SMTP id dr9mr71679338ejc.248.1636107025456; Fri, 05 Nov 2021 03:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636107025; cv=none; d=google.com; s=arc-20160816; b=CLS0hdvdSq6VkarKLIyEk4+ABghoEbUu4PSX5rMeP6Np4lK9iz7/VdyeEp68dXJ3BL B+5ofvXCdNmyuZmFd3giiSO1ezlbhqwgoQFFRQH41RoTcY/QltnTwCDOLc6RQXX88Jdu iLaO4QHsyCibmdLb4Y/ZcHGO4HPD4838oD+8i/okCjGieBRk76NchG77EMaWwF6EhVou mYIuWRIlOLS4H8ibieFEEkJsO0woYep/F5bPbO8bTL4/rZRG5sqYAsCmRxZY1OIUpFMn jnNXS2uVSlyH1RY6+SX4GM9rFJhmg5GKSj5RHLwjDF9zyQdATm4dU5CGFF1Bxn5TD1Ma ZZ8g== 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=kO2RGe0tyP64YcqLHdEFa/QfJmIJMDikgd0C/SQ5ShI=; b=vWagc27dhrmCkRRy3xFm9ESpi5xzqDOvnGxYzEw6N3BIImX8nqiY2cXDuFJl6yeieY gqdYeQN+Oa2DTA6iqY66rnZG1i89kOynS8+vc0fThmUWaU71c2zOS7a0GvjqWu7b4JSb 8vX4V4EhOuaR+c71zFPuD6vRrG0IQRP+uBqOTD/p/R9io8ZNrZY62xPSbo37HQlcIVxA drd7XlVWtvppPP+trzjv/web5p3wUY00ZWLFRZALuuDQDuXJhgugTr40rhSzkrJFDuGG bUunrvjRNeLdNqwnCGQEWnZtpgrGixWm1Cf24Zip74q1oohFs+5ZDGzke0IO1eOrJ+j4 Vqtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si11777744edx.79.2021.11.05.03.10.01; Fri, 05 Nov 2021 03:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233007AbhKEKKu (ORCPT + 99 others); Fri, 5 Nov 2021 06:10:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:52922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbhKEKKt (ORCPT ); Fri, 5 Nov 2021 06:10:49 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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