Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp965309pxj; Thu, 27 May 2021 16:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo2+XFacWu4qXPVpOyQP3xQtAoyIi5dTSh7YVay5yj27WOL0lEJKTm0T3NLCTpgnFCoxMV X-Received: by 2002:a05:6e02:1c2c:: with SMTP id m12mr4605510ilh.188.1622157863428; Thu, 27 May 2021 16:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622157863; cv=none; d=google.com; s=arc-20160816; b=WCNZpMZ0m25s2Jf4SHNU7uSFyf+/OssAN8hGk7+XfgVDk/DILMH7G71plDW0At1t9N L/jIWqhEbm+OTXYX7LheUff/H2JithlLjniqqbmpDR4f28x8UVypm4nuEorGGBzHWQJn 19QDPUUfNJ2W7t6tiptW/Z4MpDDzoQjlb21AtNcrSaBez+GS76UU8RwoE+Vq1hRNkho1 leiTv+jaC/8k5S6B8Fy8ZKJpU6vvJyj8A4vO1FKRgqZf3vUxsSUWj4fOgzbs2MdV8i3D uqYtNtKshBugjtiBzV9Z+yRtU6U/6KxVIA53rQ5zbvaFWt73XVUzQT+3gJDACf0zbR5q /MBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=8lsmCRNYrZ6k0cDT/4VZ1L5OxONyl/358I5j7TC80KU=; b=v1SnlPljBZJyZUA/SL+ucF87Vm1ivlilS9h5AwSIEHth/PsBhrqnCiEgJRDtayxXbl zqsvfmshdo9dx7UUUcILJGq3VVVBlSt8JDYbDPX5nfa1y74cMxJsBs0eNrt6BYKSXtLJ yowrnkjdlAPJFEN37YHMB5OyifMi6+1UtGVdVAmPtbw1gWEzhYoGaaANIibQ0heAarTu vCwExI03PGUR5jXmsqk7cQbDHLGjqg6NBng5+UmztA99vW916+wLWBW8jbKLEflUn0cH F4omFk0yrQPqF6VTNg1T2Q2sXcXv47Cn0GLUUJZcm5VzNsPplNBoQRfngoKdLdvk0xs/ J/hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=jz9CVWHu; 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=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si3784717ilc.44.2021.05.27.16.24.09; Thu, 27 May 2021 16:24:23 -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; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=jz9CVWHu; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236687AbhE0RB6 (ORCPT + 99 others); Thu, 27 May 2021 13:01:58 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:21538 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233674AbhE0RB5 (ORCPT ); Thu, 27 May 2021 13:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1622134824; x=1653670824; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=HiNVqjxm3qys3CVLirQSiLg09ThgTKZt+rV3bnxp1dc=; b=jz9CVWHucnm2Xv8OfvCyG83DL/+1Rs1Pme4iOK384Bj5GUJmXwglFwyi JkWeKb5I/L4AXZCXIePoLp9gWh0VdjDIyUREBqjPfVMIznzntd6oQlGkM iRrqkxQXxeVmWKuzky8qRfWd+1OsaHkIwjk9iea5yDMaQ6IikcA02bzP4 g=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 27 May 2021 10:00:24 -0700 X-QCInternal: smtphost Received: from nalasexr03e.na.qualcomm.com ([10.49.195.114]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 27 May 2021 10:00:22 -0700 Received: from [10.111.161.43] (10.80.80.8) by nalasexr03e.na.qualcomm.com (10.49.195.114) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 27 May 2021 10:00:21 -0700 Subject: Re: Arm64 crash while reading memory sysfs To: Mike Rapoport CC: Andrew Morton , David Hildenbrand , Catalin Marinas , Anshuman Khandual , Ard Biesheuvel , Linux Memory Management List , Will Deacon , Marc Zyngier , Linux Kernel Mailing List , Linux ARM References: From: Qian Cai Message-ID: Date: Thu, 27 May 2021 13:00:20 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm03g.na.qualcomm.com (10.85.0.49) To nalasexr03e.na.qualcomm.com (10.49.195.114) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/27/2021 12:22 PM, 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. Interesting, it seems those memory did come back after booting. # cat /proc/meminfo MemTotal: 116656448 kB MemFree: 110464000 kB MemAvailable: 101919872 kB Buffers: 16320 kB Cached: 118912 kB SwapCached: 3136 kB Active: 63360 kB Inactive: 199936 kB Active(anon): 9792 kB Inactive(anon): 132480 kB Active(file): 53568 kB Inactive(file): 67456 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 8388544 kB SwapFree: 8344704 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 125056 kB Mapped: 44992 kB Shmem: 14784 kB KReclaimable: 92160 kB Slab: 4943424 kB SReclaimable: 92160 kB SUnreclaim: 4851264 kB KernelStack: 24832 kB PageTables: 10240 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 66716736 kB Committed_AS: 708096 kB VmallocTotal: 133143461888 kB VmallocUsed: 49600 kB VmallocChunk: 0 kB Percpu: 45056 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB ShmemHugePages: 0 kB ShmemPmdMapped: 0 kB FileHugePages: 0 kB FilePmdMapped: 0 kB CmaTotal: 0 kB CmaFree: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 524288 kB Hugetlb: 0 kB > >>> 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. That patch fixed it.