Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp806490pxj; Thu, 27 May 2021 12:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo5+F6ofxWaFRQVlBHQHFV6Yu68hKmyF8yl7+ep97EmbF1UvxuZLSqM+yszu5seWukqTMm X-Received: by 2002:a02:9208:: with SMTP id x8mr4847145jag.18.1622142277189; Thu, 27 May 2021 12:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622142277; cv=none; d=google.com; s=arc-20160816; b=ANElNl3geIDN73w6cDzlLLzwYoqXdV4havJhqLeaRb61uDIgDemZQ64j0tGlR4Rnuu tBT4NO8i3iScqztKcT1OfsivaixRC48Bb6ZKGayv4wBxLHQhmpK1wdnYpiS4Lko0m9bE JHAm466e1vEAJIEijSlXeZloW9O+AvY5Ug+AAWEc7x1hTfDqg1cPg5n/rGhLz6c0x+16 5fFWDNnCSB5W8sGztJBGo/Ns8XTBZP0KRdWW1MwAGygNQ2Wu/kandhwU1RFqlF6XcCeS YirXcMXjm8G6CoeVZHQUxVTuhBsHSyGq+bIXsO8puOxJJynWa5rlkg6PzKTU+GoqIyaY ++zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KPFfHez66A1JVO5ZirFJrVA7Hy7s5mQKxatKvuk6S2M=; b=jWK7nUAgdJ6koH2qBOvq/XTcLL1WU9mGPnECmiHJa6Fu5IUKMZSGpItQlTMkwqy7fR kZ58lb36q+JN5TxAl4ze9dIX99LCRVYLaeazOLQOeaDNGp+S/7/Z9F1a8H5LR98qBn/5 b13gvIrA/tKlu6MKei1aD1VhBz4mvei/9MFA8FQGTj35U/bkXaRvwacwB+tTW1XMlZKQ c3CC4u1Agkw7MGvFAY1ecaUSLE4wGrvfv+wkmROyn6A8Qlk0VG6IyFi2YrsvhPHzfN+Y 4Gs3LXiLPe9zcHC6ThEsVLkpo8S/6oNNfxLZ+stTeWk6S++Eep8XlilDzNRZPy7KX2wB ta3A== 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 w11si3710562ilq.20.2021.05.27.12.04.22; Thu, 27 May 2021 12:04:37 -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 S235466AbhE0Rw0 (ORCPT + 99 others); Thu, 27 May 2021 13:52:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:45888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbhE0RwZ (ORCPT ); Thu, 27 May 2021 13:52:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91678613AB; Thu, 27 May 2021 17:50:50 +0000 (UTC) Date: Thu, 27 May 2021 18:50:48 +0100 From: Catalin Marinas To: Mike Rapoport Cc: Qian Cai , Andrew Morton , David Hildenbrand , Anshuman Khandual , Ard Biesheuvel , Linux Memory Management List , Will Deacon , Marc Zyngier , Linux Kernel Mailing List , Linux ARM Subject: Re: Arm64 crash while reading memory sysfs Message-ID: <20210527175047.GK8661@arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 07:22:00PM +0300, Mike Rapoport wrote: > On Thu, May 27, 2021 at 10:33:13AM -0400, Qian Cai wrote: > > On 5/27/2021 4:56 AM, Mike Rapoport wrote: > > > Let's drop memblock=debug for now and add this instead: > > > > [ 0.000000][ T0] Booting Linux on physical CPU 0x0000000000 [0x503f0002] > > [ 0.000000][ T0] Linux version 5.13.0-rc3-next-20210526+ (root@admin5) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #31 SMP Thu May 27 12:32:40 UTC 2021 > > [ 0.000000][ T0] Inode-cache hash table entries: 4194304 (order: 9, 33554432 bytes, linear) > > [ 0.000000][ T0] mem auto-init: stack:off, heap alloc:on, heap free:off > > [ 0.000000][ T0] MEMBLOCK configuration: > > [ 0.000000][ T0] memory size = 0x0000001ff0000000 reserved size = 0x0000000421e33ae8 > > [ 0.000000][ T0] memory.cnt = 0xc > > [ 0.000000][ T0] Memory: 777216K/133955584K available (17984K kernel code, 118722K rwdata, 4416K rodata, 6080K init, 67276K bss, 17379072K reserved, 0K cma-reserved) > > I still cannot understand where most of the memory disappeared, but it > seems entirely different issue. > > > > Sorry, I've missed that the BUG is apparently triggered for pfn + i. Can > > > you please try this instead: > > > > [ 259.216661][ T1417] test_pages_in_a_zone: pfn 8000 is not valid > > [ 259.226547][ T1417] page:00000000f4aa8c5c is uninitialized and poisoned > > [ 259.226560][ T1417] page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p)) > > Can you please try Anshuman's patch "arm64/mm: Drop HAVE_ARCH_PFN_VALID": > > https://lore.kernel.org/lkml/1621947349-25421-1-git-send-email-anshuman.khandual@arm.com > > It seems to me that the check for memblock_is_memory() in > arm64::pfn_valid() is what makes init_unavailable_range() to bail out for > section parts that are not actually populated and then we have > VM_BUG_ON_PAGE(PagePoisoned(p)) for these pages. I acked Anshuman's patch, I think they all need to go in together. -- Catalin