* Question about ARM KVM stage2 contiguous bit support for contiguous hugetlb
@ 2026-03-13 7:09 Zhou Wang
2026-03-13 7:49 ` Marc Zyngier
0 siblings, 1 reply; 3+ messages in thread
From: Zhou Wang @ 2026-03-13 7:09 UTC (permalink / raw)
To: linux-arm-kernel, kvmarm; +Cc: tangnianyao, jiangkunkun, xuwei (O), Zengtao (B)
Hi,
Current KVM stage2 supports contiguous hugetlb, e.g.4KB basic page size, 64KB hugetlb.
However, contiguous bit is not set in PTE, so there is no hint for hardware to create one
TLB for a contiguous huge page.
Seems to support this feature. We should do:
1. In user_mem_abort, do not force to do PTE map for CONT_PMD_SHIFT/CONT_PTE_SHIFT,
just map all contiguous pages at one time.
2. Add contiguous bit in above process.
3. Modify the permission fault related code. As in the first point, we change vma_pagesize
actually, vma_pagesize will be not equal with fault_granule, we will fail to enter into
kvm_pgtable_stage2_relax_perms.
4. The split of contiguous hugetlb should be considered. We need remove all related contiguous
bits, once one PTE has been changed.
Note sure if I miss any point to implement this feature. And do we have any plan to support this?
Best,
Zhou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about ARM KVM stage2 contiguous bit support for contiguous hugetlb
2026-03-13 7:09 Question about ARM KVM stage2 contiguous bit support for contiguous hugetlb Zhou Wang
@ 2026-03-13 7:49 ` Marc Zyngier
2026-03-19 12:54 ` Zhou Wang
0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2026-03-13 7:49 UTC (permalink / raw)
To: Zhou Wang
Cc: linux-arm-kernel, kvmarm, tangnianyao, jiangkunkun, xuwei (O),
Zengtao (B)
On Fri, 13 Mar 2026 07:09:40 +0000,
Zhou Wang <wangzhou1@hisilicon.com> wrote:
>
> And do we have any plan to support this?
Not really.
Configurations that are looking at extracting the best possible
performance use large mappings at S2 (hugetlbfs). I'm not convinced
that there is a strong use-case for dealing with the contiguous hint
at S2 when backed by anonymous memory. If you're not under memory
pressure, THP already gives you the uplift you want. If you are under
memory pressure, you're unlikely to get the contiguity you want.
Additionally, dealing with the contiguous hint is a real pain.
If you are undertaking this work, please make sure to provide
reproducible benchmarks and results that show a definite improvement
on the majority of workloads.
Thanks,
M.
--
Jazz isn't dead. It just smells funny.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about ARM KVM stage2 contiguous bit support for contiguous hugetlb
2026-03-13 7:49 ` Marc Zyngier
@ 2026-03-19 12:54 ` Zhou Wang
0 siblings, 0 replies; 3+ messages in thread
From: Zhou Wang @ 2026-03-19 12:54 UTC (permalink / raw)
To: Marc Zyngier
Cc: linux-arm-kernel, kvmarm, tangnianyao, jiangkunkun, xuwei (O),
Zengtao (B)
On 2026/3/13 15:49, Marc Zyngier wrote:
> On Fri, 13 Mar 2026 07:09:40 +0000,
> Zhou Wang <wangzhou1@hisilicon.com> wrote:
>>
>> And do we have any plan to support this?
>
> Not really.
>
> Configurations that are looking at extracting the best possible
> performance use large mappings at S2 (hugetlbfs). I'm not convinced
> that there is a strong use-case for dealing with the contiguous hint
> at S2 when backed by anonymous memory. If you're not under memory
We want use 64KB basic page, in this case we have 2M cont PTE and 512M
block page. However, the latter may waste more memory.
> pressure, THP already gives you the uplift you want. If you are under
> memory pressure, you're unlikely to get the contiguity you want.
>
> Additionally, dealing with the contiguous hint is a real pain.
>
> If you are undertaking this work, please make sure to provide
> reproducible benchmarks and results that show a definite improvement
> on the majority of workloads.
We have a initial test in hardware emulator, for lmbench lat_mem_rd 1G
256 stride,the cost of virtualization will change from 17% -> 3%, we do
the test using a VM with 4 vCPU / 8GB memory in 64KB basic page / 2M
contiguous hugetlb system.
Will do more tests in the real chip.
Best,
Zhou
>
> Thanks,
>
> M.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-19 12:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 7:09 Question about ARM KVM stage2 contiguous bit support for contiguous hugetlb Zhou Wang
2026-03-13 7:49 ` Marc Zyngier
2026-03-19 12:54 ` Zhou Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox