[RESEND PATCH v7 04/10] mm: thp: Support allocation of anonymous small-sized THP

Barry Song 21cnbao at gmail.com
Sun Nov 26 19:41:35 PST 2023


> +	if ((nr_pages == 1 && vmf_pte_changed(vmf)) ||
> +	    (nr_pages  > 1 && !pte_range_none(vmf->pte, nr_pages))) {
> +		for (i = 0; i < nr_pages; i++)
> +			update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i);
>  		goto release;
>  	}

Hi Ryan,
what has stopped nr_pages == 1 from using !pte_range_none(vmf->pte, 1)
directly, then the code can become,
+	if (!pte_range_none(vmf->pte, nr_pages)) {
+		for (i = 0; i < nr_pages; i++)
+			update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i);
 		goto release;
 	}

for both 1 and > 1 cases?

Thanks
Barry




More information about the linux-arm-kernel mailing list