From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62D4AC47089 for ; Thu, 27 May 2021 17:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 410C060241 for ; Thu, 27 May 2021 17:00:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236731AbhE0RCD (ORCPT ); Thu, 27 May 2021 13:02:03 -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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5D8C47089 for ; Thu, 27 May 2021 18:33:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C7DD61284 for ; Thu, 27 May 2021 18:33:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C7DD61284 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6pbizDz9HHFuiy4djvcJrMgnIJR+FHtxGxvAtPK0zkc=; b=1RB+tdfcgT6D+7Z8/Qpny27Umd huqOcUAICu7EN+hAT2bB6q1OWdF6iqXgZ7Akupeaz6KnexE/aSeI95fcKiK2n/BGO2M9Al8tK5WGv Varu6uy9/xIiT0ODOaNne266I1O4XPuWkp2LcK6G6rVDMcW4D0OT7drmZvozMA6xzxsbR+s2uWLBb KVLGZ4TbHzTpwjI1urzFd1cxoETVzC/z3lBtTQNmvHRrXrJCTveKg3nVbGvYRmDmm8BXcGHJTZNGp js7p/SNm3TMichQUsrYOHGM+VZes7HRIRC8H18dFvR33/lDYHJ2j0cZIZUzSOaAzRUW+7HdCIez1Y 1g3FSohg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmKmD-008V36-9c; Thu, 27 May 2021 18:30:38 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmJMw-007sTR-69 for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 17:00:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1622134826; x=1653670826; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=HiNVqjxm3qys3CVLirQSiLg09ThgTKZt+rV3bnxp1dc=; b=NvoUEbSWdL21Pkeu7oSwp0bG0tsLNWdJDhWYMRzgTpDXaKmwklKdVsNV yYJk/TDUYihKziHiyEdbzonMnaAu1jTAT4CoDClN4uF4jbaXJwiEoCdBm 1Q2qDqd6VvTAgQBo1Z2IVjwCKzkqPHuxF/iVdcC+HFtLqc7CX4MllGA3v Y=; 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-Language: en-US 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_100026_354753_72113328 X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel