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 4BF6EC47082 for ; Wed, 26 May 2021 17:25:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA317613C3 for ; Wed, 26 May 2021 17:25:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA317613C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 786826B006E; Wed, 26 May 2021 13:25:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75AFB8D0002; Wed, 26 May 2021 13:25:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D53A6B0071; Wed, 26 May 2021 13:25:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 2C90A6B006E for ; Wed, 26 May 2021 13:25:19 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C16A88249980 for ; Wed, 26 May 2021 17:25:18 +0000 (UTC) X-FDA: 78184058316.28.0E5E4EE Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf02.hostedemail.com (Postfix) with ESMTP id 531A140002FF for ; Wed, 26 May 2021 17:25:14 +0000 (UTC) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14QHP2YQ144455; Wed, 26 May 2021 13:25:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=BcNi/E4J69pn4dNKoVAv0uJlQzSvrjXxDhv3YnEHa9I=; b=kZI3xdr8i7fSCVdXmGIcljHkx1PElvhDd5+Ql0R0mHScYcBuf2L2GEET1+qrOB/kOJAs +n/1jaU6vjUBvFxcjpuOUVJDPDvmn0hhTp4mSU1FmKIDDWe4N6KfjwUtDdbWhGgy0rTz LmyaWXNGYieJ5oR4vFtWv4cMpDIJqogNQXJW6XQTfUFzgUKypilw1Sk3qp1zncXQ0Yg3 62YRzIcWyX1IwEIzgy80Ekf4vtpIiF2zA51y2+l7Cp3naXsajis6vCAlK4SFgebABMD/ hSCcZWS/VUUCZ7XnmuOa1ktRAzG0z9z4t5AEgclPxV2YGQ0rOe8RIcSa4NyCDb4Dn6jz rQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38stqb002n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 May 2021 13:25:13 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14QHPCvJ000906; Wed, 26 May 2021 13:25:13 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 38stqb0027-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 May 2021 13:25:12 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 14QH7pvQ029803; Wed, 26 May 2021 17:25:10 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 38s1r48s3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 May 2021 17:25:10 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14QHOclL33554898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 May 2021 17:24:38 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A7C0A4069; Wed, 26 May 2021 17:25:07 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FC91A405B; Wed, 26 May 2021 17:25:06 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.39.77]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 26 May 2021 17:25:06 +0000 (GMT) Date: Wed, 26 May 2021 20:25:04 +0300 From: Mike Rapoport To: Catalin Marinas Cc: "Qian Cai (QUIC)" , 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: References: <20210526130426.GD19992@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210526130426.GD19992@arm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: SvMP2yqVC7yeAmHto_8H_DXErAIaLv8b X-Proofpoint-ORIG-GUID: JhfW_8a7tKAzwDeqWzdu2l-in_x29H7X X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-26_10:2021-05-26,2021-05-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=898 suspectscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105260115 X-Rspamd-Queue-Id: 531A140002FF Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=kZI3xdr8; spf=pass (imf02.hostedemail.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam04 X-Stat-Signature: mqsitw8qbs7papqbx6qkdzcbu1pikeqy X-HE-Tag: 1622049914-685968 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 26, 2021 at 02:04:26PM +0100, Catalin Marinas wrote: > On Wed, May 26, 2021 at 12:09:14PM +0000, Qian Cai (QUIC) wrote: > > [ 0.000000] Early memory node ranges > > [ 0.000000] node 0: [mem 0x0000000090000000-0x0000000091ffffff] > > Maybe de-selecting HOLES_IN_ZONE is not correct for arm64 in all > circumstances. In a configuration with 64K pages, MAX_ORDER is 14, > MAX_ORDER_NR_PAGES is 8192, so a 2^29 address range. However, the above > range starts on 2^28 boundary. > > SECTION_SIZE_BITS is 29 in this configuration but the corresponding > mem_map[] in the first half of the first section is probably not marked > as reserved as we'd do for NOMAP. We do initialize (or at least we should) the first of the first section in page_alloc::init_unavailable_range() so the range [0x8000000 - 0x9000000] will have struct pages marked as reserved. I think it should be fine to de-select HOLES_IN_ZONE as long as MAX_ORDER chunk does not exceed a section because we do have memory map there in such case and HOLES_IN_ZONE along with pfn_valid_within() protected against access to non-existing memory map entries. We still have an issue with memory map initialization, and probably I've missed something in decoupling of "do we have memory there" from pfn_valid(). -- Sincerely yours, Mike.