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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 40659C4707F for ; Thu, 27 May 2021 16:22:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22A466128D for ; Thu, 27 May 2021 16:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234107AbhE0QXx (ORCPT ); Thu, 27 May 2021 12:23:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:30656 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229596AbhE0QXw (ORCPT ); Thu, 27 May 2021 12:23:52 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14RG4MX6167881; Thu, 27 May 2021 12:22:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pp1; bh=ORzFNe0G+WYzU2+JA9c9h8YyxTQJ1yH3Q1Z/MeSInEQ=; b=JafX2+5D+7BakRDR+/+2QK+aj2fxfzqPIfVGwq//+YXg7k87jj+35Ay8QNbF3uMzv50o Fis/9jbBeu6CNQjCoBTibn1RcShloPKjPr0z4z5trl5SakcMuSBCIetXppgwSTZrENKB +e+HAWIgUwjM1/sLqNTnIx+sVwO4M8DspgC8GTZGy3qYPL2OyDX+P4wB+qv+z83IyPl0 2IojJZN+bGDdtMN9HBSLmIOsYwr9Qqd0yZo6ZFQelTKo4UQfQMjbefXduJ1yQgsqHRDo MZsEQlefS0GuXuYHj0KB2O+f/T3vrz6ngfKq5MYWoPtmFV/b0dnBIDhDtPAYgDcTHb15 4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38td0wd256-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 12:22:08 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14RG4ngV170032; Thu, 27 May 2021 12:22:07 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 38td0wd249-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 12:22:07 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 14RGIBoZ017591; Thu, 27 May 2021 16:22:05 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06fra.de.ibm.com with ESMTP id 38swpa08bs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 16:22:05 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14RGM3xK31981876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 May 2021 16:22:03 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E76FA4051; Thu, 27 May 2021 16:22:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C65FA4057; Thu, 27 May 2021 16:22:02 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.39.77]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 27 May 2021 16:22:02 +0000 (GMT) Date: Thu, 27 May 2021 19:22:00 +0300 From: Mike Rapoport To: Qian Cai 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 Subject: Re: Arm64 crash while reading memory sysfs Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: qMqVU8FV7I7pQ1xz4BBZteNHh9eULiaL X-Proofpoint-ORIG-GUID: 3YnKkD0oZZyebVhkuWkrs9KO5l6fd8oM X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-27_07:2021-05-27,2021-05-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=762 lowpriorityscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105270104 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Sincerely yours, Mike. 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3F29EC47089 for ; Thu, 27 May 2021 17:58:28 +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 02C5C613AB for ; Thu, 27 May 2021 17:58:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02C5C613AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.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:MIME-Version:In-Reply-To:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A8vRehbI6ZdBvZnjyAnPm8f9AoJS7oXT9Xi0H7Oz3hc=; b=nfs8Q77qFSIahT nItqq57TsX67avLK/oP0YbcNCWnxupGXu18UMU5jjesL37lzNEUoAbjmil7kF8HsIISrl8RXTIfGD S4ZwLQa4fV6rmZBo0sAQ5PCQAEEpA/U9luLrxH2lo0q0x68DrVjEuqsdhX7bQ2icJRE7Q/UJ8WEHH oZnkaaQrYiSwBRld3jRsohajjwru1HAsLUlg11inGtlz2TXLcVIp2oJ50mKDVeQiYNncTW4zm3fy7 BSCoWItuV6y94p33KwKVgBFDaE7CDqXBrpaITK9gmGbm8kXyGdYWoV2rpTUX/bjrWOale1KLhinwx tsOsqcvWvvbOefiROJ/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmKEe-008H9s-HY; Thu, 27 May 2021 17:55:58 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmIly-007Zc1-RS for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 16:22:16 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14RG4MX6167881; Thu, 27 May 2021 12:22:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pp1; bh=ORzFNe0G+WYzU2+JA9c9h8YyxTQJ1yH3Q1Z/MeSInEQ=; b=JafX2+5D+7BakRDR+/+2QK+aj2fxfzqPIfVGwq//+YXg7k87jj+35Ay8QNbF3uMzv50o Fis/9jbBeu6CNQjCoBTibn1RcShloPKjPr0z4z5trl5SakcMuSBCIetXppgwSTZrENKB +e+HAWIgUwjM1/sLqNTnIx+sVwO4M8DspgC8GTZGy3qYPL2OyDX+P4wB+qv+z83IyPl0 2IojJZN+bGDdtMN9HBSLmIOsYwr9Qqd0yZo6ZFQelTKo4UQfQMjbefXduJ1yQgsqHRDo MZsEQlefS0GuXuYHj0KB2O+f/T3vrz6ngfKq5MYWoPtmFV/b0dnBIDhDtPAYgDcTHb15 4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38td0wd256-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 12:22:08 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14RG4ngV170032; Thu, 27 May 2021 12:22:07 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 38td0wd249-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 12:22:07 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 14RGIBoZ017591; Thu, 27 May 2021 16:22:05 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06fra.de.ibm.com with ESMTP id 38swpa08bs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 May 2021 16:22:05 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14RGM3xK31981876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 May 2021 16:22:03 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E76FA4051; Thu, 27 May 2021 16:22:03 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C65FA4057; Thu, 27 May 2021 16:22:02 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.39.77]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 27 May 2021 16:22:02 +0000 (GMT) Date: Thu, 27 May 2021 19:22:00 +0300 From: Mike Rapoport To: Qian Cai 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 Subject: Re: Arm64 crash while reading memory sysfs Message-ID: References: Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: qMqVU8FV7I7pQ1xz4BBZteNHh9eULiaL X-Proofpoint-ORIG-GUID: 3YnKkD0oZZyebVhkuWkrs9KO5l6fd8oM X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-27_07:2021-05-27, 2021-05-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 clxscore=1015 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=762 lowpriorityscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105270104 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_092215_168321_145EA3EE X-CRM114-Status: GOOD ( 21.77 ) 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 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. -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel