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 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 66304C47082 for ; Wed, 26 May 2021 18:30:33 +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 2CA1E613AB for ; Wed, 26 May 2021 18:30:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CA1E613AB 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:In-Reply-To:MIME-Version: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=swaP24J1iknUn3+JV7C2Pc5/RiiukGhAiLRg2QEfZps=; b=H3llsaKwq2cdiX Uq3sevOVAy03L8m/Q39jH0ThHs8gMnr68HJwmycx+y5cJMc2qD6bESbJjBA5NMjUoHgc6UDvbJwy/ EOXO9a7+0KG725niXQvF+i0qylqA8Qe1ZMsqnEINuEM9IBVUdGWpBR83f+VBEinIxwQY9wqXzpR64 3pyNaGoGv3oVbsu0cUuOzjlHprQ9dJ+GoeustH62N/YF6SiumFAlmzDjfX5danPM8l9RPPpYaUDPC VSb/fpIckVRx6m9S/ZArjdCQVDUI6JdcX7lv+DaUbazgMNOMHXbPeX6j/tzWoGV5MmTmDwfYbcHfa 3EfrLil61xRkFTYqV5RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llyFS-00GVtV-Nf; Wed, 26 May 2021 18:27:21 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1llxHU-00G68v-0i for linux-arm-kernel@lists.infradead.org; Wed, 26 May 2021 17:25:21 +0000 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-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210526_102520_106884_44D94EDD X-CRM114-Status: GOOD ( 20.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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel