From patchwork Mon Dec 9 09:42:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenhua Huang X-Patchwork-Id: 13899146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 537C7E77173 for ; Mon, 9 Dec 2024 09:43:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C180E6B03EA; Mon, 9 Dec 2024 04:43:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC7EF6B03EB; Mon, 9 Dec 2024 04:43:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8F526B03EC; Mon, 9 Dec 2024 04:43:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8C2B76B03EA for ; Mon, 9 Dec 2024 04:43:00 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1860BC037B for ; Mon, 9 Dec 2024 09:43:00 +0000 (UTC) X-FDA: 82874930880.25.D4EE614 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf05.hostedemail.com (Postfix) with ESMTP id DDB6910000F for ; Mon, 9 Dec 2024 09:42:18 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=CVJ7DvfT; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf05.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737359; a=rsa-sha256; cv=none; b=wuvY93+FSwFD/9NfDoj4Dme/pgvX47L52IHrwJv/WlAtOhUJYDXFrnLMdSZrjaNGlA7eNS M0uOujUDHrpJOoTHuT4+pFo29uzoU33KaM9uOyayLre0+oDl7mok+yqCLO+WMmnlj7/760 MKgDZxnuRXtjHB+VWXcWaWQTIu7B5TA= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=CVJ7DvfT; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf05.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737359; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=TBBcsGnUIismUG5M3WVT1h0rVoJD1839Z45T+RuqpKw=; b=TqbnDkyH1MujRdQ8xrLN+OsWfuq9n3DAXPBWhfj1GC10+Lnukna0wxp0hLoiKj8hX01Lo9 GkK6v2/jiThvv4a3MCcJr5U8ynSujVpMacQvpjIPjnJD52FS8aS66x2Zl6JnWGbnr7cQFE RmW6FI+ulsXMCpeVW0u3lxI42OZQkRI= Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B8Natjq022156; Mon, 9 Dec 2024 09:42:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=TBBcsGnUIismUG5M3WVT1h 0rVoJD1839Z45T+RuqpKw=; b=CVJ7DvfT6Dp13Puxxnt1Wt1JjVCmPH5If7Go2H sh/hLV/2SX6GieDsDwjJjy8meIn/lLAZmi/1KsEd7dgsTscyjx3ruyc4Loy/WBEt pb39er6NqWaMiRjBeIo45W7EXtZfZJWCAa+rfTd/MNBxmeSN5lLhTOrkwVbKbfdy XNJPTwFeEp7e8boBYNDC1DLgPDvh++sEqgrD4maln7GOpujHbYxWCL1HvP3+z+hz D6OeZu6lf1Df2x59YbGN7kNAkiQ0fCyh9WW+l6qucxi+AR5INMiOltN7jrMmJni4 Isi0vj+l5Jx3+uT8JJVEGikfj0mjgjxS/f+nGpr3oVIIhWUA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43cdpgm6hm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 09:42:52 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4B99gpr6021596 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 9 Dec 2024 09:42:51 GMT Received: from ap-kernel-sh01-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 9 Dec 2024 01:42:48 -0800 From: Zhenhua Huang To: , , , , , , , , , CC: , , , Zhenhua Huang Subject: [PATCH v2 0/2] Fix subsection vmemmap_populate logic Date: Mon, 9 Dec 2024 17:42:25 +0800 Message-ID: <20241209094227.1529977-1-quic_zhenhuah@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cdWhVh-WYovZf2n086SfZ1G6qeakYZGR X-Proofpoint-ORIG-GUID: cdWhVh-WYovZf2n086SfZ1G6qeakYZGR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 clxscore=1011 suspectscore=0 mlxscore=0 priorityscore=1501 phishscore=0 mlxlogscore=757 spamscore=0 malwarescore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412090075 X-Stat-Signature: r6mhgip3a1xkx5oy38a9b1rxyx983eem X-Rspam-User: X-Rspamd-Queue-Id: DDB6910000F X-Rspamd-Server: rspam08 X-HE-Tag: 1733737338-72073 X-HE-Meta: U2FsdGVkX1+Oez9Anwr7KX/zexqHKXV10NsDoQVVZj6awXtdnZtUSgDd4te014km7HBHHNFlY/Zd86UxFW19wgFAVTrV1wEaKMv4t6knhg9EPcCgoA1sBt0FBPsLw4fMZgXismGsw7uN7mHA46otEykj1Ym+RvBDaP8n+K+7YK7m5fht1jIH6svyuOHStG1+tlPhdRtQjxtkUEZJ3esOqp57yLz7aSwxrwBj7TMVQlhVdVjfOjuM+Ni6LvS0ChiEhYbjZsk0mOLEgWJ0/EffJPf4T2bGosTsKlrMwX8MmLAnMY7SRuI4LCz+cq05epzDBQBwJmyMPf+T1l8NiISFQnK0dLGACg8Nj789i0F8847VMWzQdPHUVn7dccRXOF+ppnYD0HIBHW5voYRsAXFvny1HxXlNNzb4B33EobaHK8cqqrb192RRxS5NOM2LK0ADN05S8gJ4VDlciHge7KCQJSfp1SSHvSe11kKVnD8iuxp+rbhPgzCNoZlPjRlJAv9mZDW5yRJ1fMjRydjka9uRLMUSCzKtF5J+4sd4fOZnmlrLHImH6a+9ZVpCztCiNxPvp2exIhmzIpMNbfsYJ+0XQhDMg+KesVpDoupplPCNTQ122tPPTfTkmPlDCYsPVLlCMpg84lr9m8/IP1xNUfiLPuPHNaEissTv37VJw2UMLh26n/Po8S+Dq0bnndVdN5ksDuDFqwOWI01IXtCP9FPaAUEEK6V76Yck+wqW0BZDEsdeoMtFMSdAS+Mt1Va87MF+481j3SfySbmMP82hYqQbxYcmFdpdM7gi2z3ZtNfc+Rw7vTe9UnslyUC4goPdsMMyvBwL5hLAYelQnU3pM79BwFrCkbFNDlj8tRrGKVT0kT0N5+F2bPtbKAfVuIP4Z1H2LFqzCraYiiahzkVP/uDSq7NnFfBGeEgvABDYW/2c/nthRQUYACEw4CCDMCIjOAPY1LFyn7LUojZGi6j1FBc FGi1l2NS IoukRsvDIkotCeFNTi5WdN8IUvQw+fpm1gd7gMOtWTsMnwHIeitl0l793GdtWolD8x4P8touTrK/tcwbgdKAXctQNGxB9dLMjoiTmnL/G4eS2KBYovb4bYwRlhWsMHPNzfyLVt71ZxqDrt4Wnz+spIqYPQBYkIDBaMWkA8XQmenjEQub4cafwCTS95lUqI8kFx+SkIq8DWXLLbk6QClupimu2062e9poG+qXtLe/qkM/tIoYnTUHNO8jNjNTHan+IHu/zm4G4p41npBN2qHoneC3IizTtBBIACOJ1XlJ42/BQzXYNAr6569EG2w== 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: List-Subscribe: List-Unsubscribe: To perform memory hotplug operations, the memmap (aka struct page) will be updated. For arm64 with 4K page size, the typical granularity is 128M, which corresponds to a 2M memmap buffer. Commit c1cc1552616d ("arm64: MMU initialisation") optimizes this 2M buffer to be mapped with one single PMD entry. However, commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") which supports 2M subsection hotplug granularity, causes other issues (refer to the change log of patch #1). The logic is adjusted to populate with huge pages only if the hotplug address/size is section-aligned. Changes since v1: - Modified change log to make it more clear which was based on Catalin's comments. Zhenhua Huang (2): arm64: mm: vmemmap populate to page level if not section aligned arm64: mm: implement vmemmap_check_pmd for arm64 arch/arm64/mm/mmu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)