Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5516476pxj; Wed, 26 May 2021 12:23:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwivdmwArjrO873nzQjAN5yq2hUD6d7Wrz/YVLZiTahq0iq+yrLpMlsY5TtBNKQK4F9tuoN X-Received: by 2002:a02:6d6c:: with SMTP id e44mr4670707jaf.81.1622057023615; Wed, 26 May 2021 12:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622057023; cv=none; d=google.com; s=arc-20160816; b=OwgrnlyJvS5hfy39iNZaOvN3DIeurt2V5qXwmkSOh6cSC854rXtPRSxZr60bS5NzLA TlRN8/4lvw11ly+Iguve5UVt86FMn7awHvwJ9NYSf2jlHnIPN+SakOPXE+7c8PWbUuUA Gnz4d1T7DVLCuKQPnrBr7UzRoYBynL33dyhF6N3OHkIyfTCPMrpkt2qdcqNcJXYUgO8P yfxEU8P2o5q6Sqwcx5qOlH9nptVaQe0QHGbiQ4M/s4yglFiSyRIEXOzx/k9NHG/8bUQH /0SZVuk8mrLGZgLwPeAIaXalzbtytCF9yNI4IohXAyvSPufdJxGFfMZsiHAWrZdZXmG7 Fb5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BcNi/E4J69pn4dNKoVAv0uJlQzSvrjXxDhv3YnEHa9I=; b=wc2IHWC8NypyqqWYTSA7+G8ClwZ6aoJcBFiVJDyQcvw+hEnZtsekcLXoDmsi6YDhVd mYgJoND9gYIJZifFMneY8xP1k7Bmke/2vTGiwWsyynd5UufAdmrl/cW94rleq60nibeh pYm7aneNcBQSWUsY4jBWiK6wHyo6kHEGs3CotVLdVITComB9wTO6ZRmjiDMC69LEUTQ2 oK3BODXOg/jiRySZJSu8C/wRiMTv0QnvYsKESofGG9SflQijrA5wL9xe5ti/72B+CYhv Fpv0uW+v+h+7laWXeuX/eum+x9Mvx9GxUIn5eq+95tXf+LaMQBFJ2C+Qwo9e1zK7pR3t c+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kZI3xdr8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si3037jan.54.2021.05.26.12.23.00; Wed, 26 May 2021 12:23:43 -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=pass header.i=@ibm.com header.s=pp1 header.b=kZI3xdr8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbhEZR0y (ORCPT + 99 others); Wed, 26 May 2021 13:26:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12474 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbhEZR0x (ORCPT ); Wed, 26 May 2021 13:26:53 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.