Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2166547imu; Sat, 10 Nov 2018 09:00:17 -0800 (PST) X-Google-Smtp-Source: AJdET5dXR/g/Eu8gfBbkb0wTNtro4YV5zjLDoj8yIPHKXo1EcTyqOp31pDiXYd9u5jt8pBpWPUw2 X-Received: by 2002:a17:902:be07:: with SMTP id r7-v6mr13317707pls.137.1541869217902; Sat, 10 Nov 2018 09:00:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541869217; cv=none; d=google.com; s=arc-20160816; b=dPtdIp94BiIF+S6PLR0Zy8AitgdMdz3pTHDKga3aYM/Ohz3zqdD4InQ1eQCWVdFDhb V51wv4e54GCaGa6X62i9poyRHwToQg6PAxPHNWk7WqxdtGlGOXW+1RNHEhXW0ePy2YuA CGQOv7hRTTXCOGqJpj2tRF63EHqbvD2U6SqMwDyQWNmiM8w0vzYb1ZzmobQ6SMK4cIB4 EkBPEEXsiVD0Y0Wct4V2CZ8OKa2Y4CL5Ix2WbE14q7HfLVD997BixE5pD3DEIJ+LLZeD UDGjHjZ4YT0dfWjoC4vecKwODXnbMKCA92Z8DB5/gOO8j60SaX2Ztqv7vcCs2kcx4bnQ 9lTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=paRoZzyOL2fXYu95zlZ9CK6//Wc4ctIpJMu4Gk8+ONM=; b=bFHZ2I429m1G7K0bRAY7dUv0MyCLRNIPefStKSSTuyQoP5Q7X32OZ6QSeV5g4wjUFQ SL0eyAGYToT1btM8TAaY+LK9sgs4wnbV0G/hJ6YFDPaR3Rjj+Yla1jcahiQIYA2s6xbg J/4YZBGC2vLn6ers0H9gPQEAnG3sLuEGv95UibxNi6UlpZw26TgKmIm37giHiQqqE7w4 9SqDeiOUY1UzkzhdwDc2knHdWL9+etLkqwT0OLEWTVXy426yw9O8IGI2rQAw4yMXVCYJ c39/pVJaIn1nJpgxCmg1jXilBgfBLVNHFiStFyktqVdkhSe5YXS6RSnCIf6rWlA/Ws0Y zHsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si11261129plc.277.2018.11.10.09.00.01; Sat, 10 Nov 2018 09:00:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbeKKCpV (ORCPT + 99 others); Sat, 10 Nov 2018 21:45:21 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44350 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbeKKCpV (ORCPT ); Sat, 10 Nov 2018 21:45:21 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 95F3480D; Sat, 10 Nov 2018 08:59:40 -0800 (PST) Received: from mbp (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 61F913F718; Sat, 10 Nov 2018 08:59:40 -0800 (PST) Received: from cmarinas by mbp with local (Exim 4.89) (envelope-from ) id 1gLWbi-00012c-Hc; Sat, 10 Nov 2018 16:59:38 +0000 Date: Sat, 10 Nov 2018 16:59:38 +0000 From: Catalin Marinas To: Qian Cai Cc: open list , linux-mm@kvack.org Subject: Re: kmemleak: Early log buffer exceeded (525980) during boot Message-ID: <20181110165938.lbt6dfamk2ljafcv@localhost> References: <1541712198.12945.12.camel@gmx.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 10, 2018 at 10:08:10AM -0500, Qian Cai wrote: > On Nov 8, 2018, at 4:23 PM, Qian Cai wrote: > > The maximum value for DEBUG_KMEMLEAK_EARLY_LOG_SIZE is only 40000, so it > > disables kmemleak every time on this aarch64 server running the latest mainline > > (b00d209). > > > > # echo scan > /sys/kernel/debug/kmemleak > > -bash: echo: write error: Device or resource busy > > > > Any idea on how to enable kmemleak there? > > I have managed to hard-code DEBUG_KMEMLEAK_EARLY_LOG_SIZE to 600000, That's quite a high number, I wouldn't have thought it is needed. Basically the early log buffer is only used until the slub allocator gets initialised and kmemleak_init() is called from start_kernel(). I don't know what allocates that much memory so early. What else is in your .config? > diff --git a/mm/kmemleak.c b/mm/kmemleak.c > index 877de4fa0720..c10119102c10 100644 > --- a/mm/kmemleak.c > +++ b/mm/kmemleak.c > @@ -280,7 +280,7 @@ struct early_log { > > /* early logging buffer and current position */ > static struct early_log > - early_log[CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE] __initdata; > + early_log[600000] __initdata; You don't need to patch the kernel, the config variable is there to be changed. > Even though kmemleak is enabled, there are continuous soft-lockups and eventually > a kernel panic. Is it normal that kmemleak not going to work with large systems (this > aarch64 server has 64-CPU and 100G memory)? I only tried 4.20-rc1 with 64 CPUs in a guest under KVM and with only 16GB of RAM (I can try on a ThunderX2 host in about 10 days as I'm away next week at Linux Plumbers). But it works fine for me, no soft lockups. Maybe something different in your .config or something else goes completely wrong (e.g. memory corruption) and kmemleak trips over it. -- Catalin