From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48E387E782 for ; Thu, 2 Jan 2025 18:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735844340; cv=none; b=H3mksixFWxpeIbQuG1eM9trsQzKAVelqesCBiTLlXn3HXePLibuJOPFVMhB7vXSa/rmiuFLkOqZDRlKP35VwtdnUhfKddUuxANqUoA1RcVgC7xgrMkVC89BmTXlK+dQqac9ybhoYsno8UgoL2LzWgRHu3dUPC6wIv4ReLy23BU8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735844340; c=relaxed/simple; bh=1CeAyE8mZcnPax2Hl/p+5TDG8fOE9udkwCcGB/cvgrE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fgFvU7PpgJNZfPPiNW2MaexXRfUlVGPGufuMLEbnwjze9LEcpb4JvsIhnif42Cd7qqX0WXdEV/6lywkGxTPlZ5ebSZ+0/qX0IbjYPSzXc/RF3e5Lzr4a6t9O720peXnFOMmwtlWaEyZ2XqnMtVZlNSVcrG0k3mGYiEE5itSZ03Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B2FAC4CED0; Thu, 2 Jan 2025 18:58:57 +0000 (UTC) Date: Thu, 2 Jan 2025 18:58:55 +0000 From: Catalin Marinas To: Anshuman Khandual Cc: Zhenhua Huang , will@kernel.org, ardb@kernel.org, ryan.roberts@arm.com, mark.rutland@arm.com, joey.gouly@arm.com, dave.hansen@linux.intel.com, akpm@linux-foundation.org, chenfeiyang@loongson.cn, chenhuacai@kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] arm64: mm: vmemmap populate to page level if not section aligned Message-ID: References: <20241209094227.1529977-1-quic_zhenhuah@quicinc.com> <20241209094227.1529977-2-quic_zhenhuah@quicinc.com> <971b9a05-4ae0-4e6c-8e48-e9e529896ecf@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <971b9a05-4ae0-4e6c-8e48-e9e529896ecf@arm.com> On Fri, Dec 27, 2024 at 01:19:30PM +0530, Anshuman Khandual wrote: > On 12/24/24 19:39, Catalin Marinas wrote: > > On Tue, Dec 24, 2024 at 05:32:06PM +0800, Zhenhua Huang wrote: > >> I have two ideas: > >> 1. Completely disable this PMD mapping optimization since there is no > >> guarantee we must align 128M memory for hotplug .. > > > > I'd be in favour of this, at least if CONFIG_MEMORY_HOTPLUG is enabled. > > I think the only advantage here is that we don't allocate a full 2MB > > block for vmemmap when only plugging in a sub-section. > > Agreed, that will be the right fix for the problem which can be back ported. > We will have to prevent PMD/PUD/CONT mappings for both linear and as well as > vmemmap for all non-boot memory sections, that can be hot-unplugged. I haven't read your diffs below yet but why not allow PMD mappings of the hotplugged memory (not vmemmap)? SUBSECTION_SHIFT is 21, so we can have 2MB blocks in a 4KB page configuration. -- Catalin