Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp695518imu; Tue, 27 Nov 2018 20:24:32 -0800 (PST) X-Google-Smtp-Source: AJdET5c+Nj5MBvExKDfq44FVXnp7zHm9tOHfkVqpR2remHRNiizGmogEHwQM/wsYa3LySe9g8Spt X-Received: by 2002:a62:2292:: with SMTP id p18mr36846058pfj.9.1543379072734; Tue, 27 Nov 2018 20:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543379072; cv=none; d=google.com; s=arc-20160816; b=rDLIdigkVUUaoSY49Grz/j5w2dVYI9tTaIjdbPFwAM3SHqI5by/MfeeAaCYlGUPtRq Kw79WpONTvVZgX81IWGSuIAWDsQ7F1wOwSG/cysrssZtqNDS3X6tlKZcesNlaMhAp16j 7RZNBurxmg/fPl0VBdy4n/Poez1fhCuhUChl91PsUlTa6SE6Zzut0zd4efniZIbhj1e3 5HIryDsytQCOmoEvXj00NOVRm/nkdOPWpOR9xQ4mPZLzTKuuVhjPtt49la310b5aX/jY Ldt+nava94Gxbfef/HbNkW7DiLNwaw2A4EULsiwtu8cG9oTRy0oEOHD96hhoorJggany BH5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=5xhHO9xzf3zvPOlYSaf7B7Mz9N2AQGvn8+Bo09a5rUQ=; b=viDiCRIq1JeoJc5VWycz2HnGNV5/FhgddGHQhVgZ2sMBT/DN1pQe579uP9bROOgcJ2 BX9fcTl5meeUEfghyrkz5+DJhaHpLW6oHIXorZx93PRuN2KxpJourxWvPm8NCJ/7KEC5 n+zDHv4oZ1Ci3+N/ARdBUD7Cs1V3Kh16WTnhJBG06YJb5kwO/7pSxzIThb4dCADDnPnH 5JamBfn0GJfCQlp1Z0KXnmy+hEEHViT92lsMkahMnWEXZCrtcgXt6ySyeneCNMimLbmn QFNfC30+YAZtD3DTgKYyQWd+M0zJdN8Og3hhy8o5AsKn4dBseOIz2UjjyY68LAbFgTZG aoeg== 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 g17si5630075pgi.578.2018.11.27.20.24.14; Tue, 27 Nov 2018 20:24:32 -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 S1727082AbeK1PWc (ORCPT + 99 others); Wed, 28 Nov 2018 10:22:32 -0500 Received: from mout.gmx.net ([212.227.17.21]:36253 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbeK1PWb (ORCPT ); Wed, 28 Nov 2018 10:22:31 -0500 Received: from ovpn-120-189.rdu2.redhat.com ([98.118.28.103]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MHLNn-1gEOp82xgh-00E8Pw; Wed, 28 Nov 2018 05:21:53 +0100 From: Qian Cai Subject: Re: kmemleak: Early log buffer exceeded (525980) during boot To: Catalin Marinas Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Will Deacon , linux-arm-kernel@lists.infradead.org References: <1541712198.12945.12.camel@gmx.us> <20181110165938.lbt6dfamk2ljafcv@localhost> Message-ID: Date: Tue, 27 Nov 2018 23:21:51 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181110165938.lbt6dfamk2ljafcv@localhost> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:A9U4XCZVDy4Vk907K3Zn6bIvRZ5ylpUUT0wYKWXMHM3gHW3mcCb IcgEiPl0WIkJgadbQ9ecTJg6nUUPwBreGjYw+sH7XVC8K7MHMOKnfiUtutc3jYi1bAcRwyH z0eBsTt6UjGW3ZDacRqRJYjNlUp5OPIem0o4mqWDaMiM/OQ8TGm6awV3haM5eL5GJgA7u6w gCOR8ZMoUk/9teaIMPxsg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OrSyPj44jMg=:WHMzUD0CsR6RKKGwmL0mWu /W+OQmdoR7ZDMZ2vMPp/kiPKcXLKeYy9samaio0qJ+GrTciLcmKSgLM/Bzvfz4EhXrsuruysa 6exRajD6uSNE6TEG+/BQ4rCNuHBs+UUh8yiSTt8tBYOykUo+Qq8qDBwOyrfqN1G8ekXV3nzJF kRPmiKVZJdUN6mNWhz/uN67nl2zswyPYm72xpxJNGNzMXD2iu+OptFh2Y/SMpC+p/AYwlaTjI SFe07qyt8Wsd3aIow6N5fc8f3pV+ABgFv6cnjMnBC/gLkJL8G1vR1TLOG9BDSD08gfx45R/7w MrYo0/eW8aI0BprZODfIya5VeojPZXo/6eHVr6q72i1x/6hhrV9MCdBnb/5ojERV6VrLPUsIU BheS9wLv6vBOoArgf4eEflBu4soiKvjLbs8jQXDDKIHt/ZwpNqboLJGKMVOBQSKBoN16Pkrij f01/NDpIrKfzpldj6u5JFDVoa0Ba9/TPh7FarRLOwLQ1WXkrS7ITtITTJDScOlho/KCT3tcH0 96jRUgh0qKrjTt/F2B7tZoSMEBm/LPntZLVv5Cb2LfRiPFW/pDaRPpQOgz46qtVPhESgL1eqp 6KUEK9DYgO8vf7py9ERMneXqR660rROkYtCxYlJeC4oEhmUqZjPv67RRLiXU5TqlgDG179/Nl ZxUxEYfVUGzx/zhH0pDk6Faf3bInm/PkN/0e7sJys6eBXHOvy5cPixGim0XXq9RKDTJfOYrt7 ElsbKbXKg8ENuTx0wCj3zLmMb/Xggwvpea23iUMxGrPfC9utplyFXv3kE6JJuJ0Ve3PWsUBou TlsnIZhjT8c8FZhVSqS3B8/m99M+tGSJ/cUYmiQSee4XdRY9XrmfpoOpsbyUCBqT6qng034RO q1NUcnsKyM+JAsDlE+s4SNNkInFaTRH0lXJzb5k3U= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/18 11:59 AM, Catalin Marinas wrote: > 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. > It turned out that kmemleak does not play well with KASAN on those aarch64 (HPE Apollo 70 and Huawei TaiShan 2280) servers. After calling start_kernel()->setup_arch()->kasan_init(), kmemleak early log buffer went from something like from 280 to 260000. The multitude of kmemleak_alloc() calls is, for_each_memblock(memory, reg) x \ while (pgdp++, addr = next, addr != end) x \ while (ptep++, addr = next, addr != end && \ pte_none(READ_ONCE(*ptep))) Is this expected?