From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2305D191F94 for ; Fri, 3 Jan 2025 07:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735888009; cv=none; b=opakk6qOGd/s4f2dNPi6YBd57legIhB8P6DUMKfKJIfWSwQfDTiyZMGfGBLw3TK9TYzxe4xu6VmqtYgvBu85JzbA0xKb/SAI8HpgoYolJYrLD9xpBQCuYvb9whxUEn2xUsTB3uihnGUk52OUUVJNOqErYwf4LNPeqxmpImYqjMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735888009; c=relaxed/simple; bh=O8IEM2f3X8RHbTuB/V3Li2AJvNx7+tvtDamjhnxdJ9M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y/pLsPozutNLSVWXtu3NEYEc4cqeZzDeLViK/4DPhS5l5oBg7bzM4BRQJ11VUyFbMUr3Y0+cAjzYA1rrydnMIGTL0YhTqTRnRCc9+Q0qn00lH8pzXUiTKkS06KofQwqipKubZDQGWN/iFZ2yqYXfF3mULijl5cFn7+TgFMGjnMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8D64A1516; Thu, 2 Jan 2025 23:07:14 -0800 (PST) Received: from [10.163.53.221] (unknown [10.163.53.221]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C91433F6A8; Thu, 2 Jan 2025 23:06:39 -0800 (PST) Message-ID: <3aed8d7d-568c-43fc-a157-cb13d6259ebe@arm.com> Date: Fri, 3 Jan 2025 12:36:36 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] arm64: mm: Test for pmd_sect() in vmemmap_check_pmd() To: Zhenhua Huang , catalin.marinas@arm.com Cc: 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, quic_tingweiz@quicinc.com References: <20250102074047.674156-1-quic_zhenhuah@quicinc.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20250102074047.674156-1-quic_zhenhuah@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/2/25 13:10, Zhenhua Huang wrote: > Commit 2045a3b8911b ("mm/sparse-vmemmap: generalise vmemmap_populate_hugepages()") > introduces the vmemmap_check_pmd() while does not verify if the entry is a > section mapping, as is already done for Loongarch & X86. > The update includes a check for pmd_sect(). Only if pmd_sect() returns true, > further vmemmap population for the addr is skipped. > > Signed-off-by: Zhenhua Huang > --- > Separate the patch out based on the discussion: > https://lore.kernel.org/linux-arm-kernel/20241209094227.1529977-3-quic_zhenhuah@quicinc.com/T/#m41d49cd91b348ecfe2c37c4b3c0911180426934e LGTM, regardless whether this patch goes on its own or via the series. Reviewed-by: Anshuman Khandual > > arch/arm64/mm/mmu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index 9afeb35673a3..50a22c63f450 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -1172,7 +1172,8 @@ int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node, > unsigned long addr, unsigned long next) > { > vmemmap_verify((pte_t *)pmdp, node, addr, next); > - return 1; > + > + return pmd_sect(READ_ONCE(*pmdp)); > } > > int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,