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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABF46E77197 for ; Thu, 9 Jan 2025 07:04:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41F756B007B; Thu, 9 Jan 2025 02:04:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CEC86B0082; Thu, 9 Jan 2025 02:04:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 295946B0083; Thu, 9 Jan 2025 02:04:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0B9BD6B007B for ; Thu, 9 Jan 2025 02:04:39 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2E3721C8699 for ; Thu, 9 Jan 2025 07:04:38 +0000 (UTC) X-FDA: 82987025436.21.78CA12E Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf09.hostedemail.com (Postfix) with ESMTP id CEDFB140015 for ; Thu, 9 Jan 2025 07:04:35 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=gWcjIkzW; spf=pass (imf09.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736406276; 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:in-reply-to:references:references:dkim-signature; bh=87FV4YrIQ7z0jxyKrabSGJYQLHTBVu6L6ppZv7huBcU=; b=Axdc0tsXv7PowYXS4nsl0iXDqjsYX6kY6AvSBPVs20skgNFFGoe3tYrBcEnIi5UyJnIQsJ T8FvTSpta8xrlpBIGAAKz2ZGhhFpACwuj+E3YwCOnFF9fZrIgpJTY5Cz6KUuYO0gDJpv6I TgP99Bl1iqqgL2uvc9ryNmwSsnGVaXc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736406276; a=rsa-sha256; cv=none; b=nPznrdr1t78g6pz3wrndc4Z+gnGHn7NfZRlboig+cXUXW6XrTBwd9Q4hcR7QbeBSjVZgAs ztTIN+g1emiuC7NGkeVixKq9+qzP2XAJ31l0oAl0mKiQ6ZzUHVRaaMnCLDEZGmFJllwJRz ljLEz8C/9oRRk8mD+DHXll87NhTymK8= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=gWcjIkzW; spf=pass (imf09.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5094gd74018333; Thu, 9 Jan 2025 07:04:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 87FV4YrIQ7z0jxyKrabSGJYQLHTBVu6L6ppZv7huBcU=; b=gWcjIkzWjCPQEr/f 1/XrfyWeVrLrNp9a1kMwPD+PycHjgQmkxj39IVopJdezCZlku10GgeyYYHkDBP4v 1b7lTSSXYmrxeYmr50SEqOXcatEugwKcA+l/f55/M7Q2wxp1hl0hZya+4aw4Mw7j IV5hFY8YmoyxLIdSPnlYRO+DtB6DjN9xG2zMocRwIBlTHano4my0VW0h3vy6RLxE RgD6sxA+Yseujey4Z2+Bs3bzT7PiN/4GmQIRe13jIDu/xtx6KjFajmB6Rt3ZA/EB NmU7iPU2VC2/XwNAlhF0s5eOxWHxNhoyWy8gKmsuWeDU+3j2GHOxNHR8cMNGvTi3 Kag6NA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4427nwr996-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jan 2025 07:04:29 +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 50974SLv020305 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 Jan 2025 07:04:28 GMT Received: from [10.239.132.245] (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; Wed, 8 Jan 2025 23:04:24 -0800 Message-ID: <1515dae4-cb53-4645-8c72-d33b27ede7eb@quicinc.com> Date: Thu, 9 Jan 2025 15:04:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] arm64: mm: Populate vmemmap/linear at the page level for hotplugged sections To: Anshuman Khandual , Catalin Marinas CC: , , , , , , , , , , , , , References: <20250107074252.1062127-1-quic_zhenhuah@quicinc.com> <406d5113-ff3d-4c2a-81f0-de791bcbeffb@quicinc.com> <1c1504a7-3515-48f2-8ca7-15b2379dea22@arm.com> Content-Language: en-US From: Zhenhua Huang In-Reply-To: <1c1504a7-3515-48f2-8ca7-15b2379dea22@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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-ORIG-GUID: xy9B2SvRFf9KMrsnmkiTJDZlnOkSlvK1 X-Proofpoint-GUID: xy9B2SvRFf9KMrsnmkiTJDZlnOkSlvK1 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 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 mlxlogscore=850 mlxscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501090056 X-Rspamd-Queue-Id: CEDFB140015 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 96a3qaeh1u11mfphw79pj756npfa1wr6 X-HE-Tag: 1736406275-969820 X-HE-Meta: U2FsdGVkX18bRgqcaw6qY0EHMha5iyWkcruXCdVU+uBvm055lBFG/FBEYVesjVH75eatXs8ntdT7SBmrsR87LeOVyKJRzZ8Tad/mwXcdmYAWyrR5/GPTOtRr0n71LPgt3v12/o0KQ9LOqxNi70dHDdVtquiMJIY1IYHVFKrLKnJjbOdPGqVwFWP3BlIHIwUAGjMyEwYN5bYdUdzd1NdBf4XC3R8uU/clA0PADMheK8syyuUGEN5iKC6kGCXpIlUdmTYpF6dl7xMsIHLuVIBQnsTLJCSd7kLbv6WnPI2/Lm23IV05wqFIkGhSpl3dkDrqT8myRIq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mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2025/1/8 18:52, Anshuman Khandual wrote: >> I found another bug, that even for early section, when vmemmap_populate is called, SECTION_IS_EARLY is not set. Therefore, early_section() always return false. > Hmm, well that's unexpected. > >> Since vmemmap_populate() occurs during section initialization, it may be hard to say it is a bug.. >> However, should we instead using SECTION_MARKED_PRESENT to check? I tested well in my setup. >> >> Hot plug flow: >> 1. section_activate -> vmemmap_populate >> 2. mark PRESENT >> >> In contrast, the early flow: >> 1. memblocks_present -> mark PRESENT >> 2. __populate_section_memmap -> vmemmap_populate > But from a semantics perspective, should SECTION_MARKED_PRESENT be marked on a > section before SECTION_IS_EARLY ? Is it really the expected behaviour here or > that needs to be fixed first ? The tricky part is vmemmap_populate initializes mem_map, that happens during mem_section initialization process. PRESENT or EARLY tag is in the same process as well. There doesn't appear to be a compelling reason to enforce a specific sequence.. > > Although SYSTEM_BOOTING state check might help but section flag seems to be the > right thing to do here. Good idea, I prefer to vote for this alternative rather than PRESENT tag. As I see we already took this stage to determine whether memmap pages are boot pages or not in common mm code: https://elixir.bootlin.com/linux/v6.13-rc3/source/mm/sparse-vmemmap.c#L465 Would like to hear Catalin's perspective ?:)