Re: [PATCH] tlb: hugetlb: Add arm64 contiguous hint awareness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 23, 2022 at 04:52:18PM +0000, Steve Capper wrote:

> +#define tlb_remove_huge_tlb_entry(h, tlb, ptep, address)	\
> +	do {							\
> +		unsigned long _sz = huge_page_size(h);		\
> +		if (_sz == CONT_PTE_SIZE)			\
> +			tlb_flush_pte_range(tlb, address, _sz);	\
> +		else if (_sz == PMD_SIZE)			\
> +			tlb_flush_pmd_range(tlb, address, _sz);	\
> +		else if (_sz == CONT_PMD_SIZE)			\
> +			tlb_flush_pmd_range(tlb, address, _sz);	\
> +		else if (_sz == PUD_SIZE)			\
> +			tlb_flush_pud_range(tlb, address, _sz);	\
> +		__tlb_remove_tlb_entry(tlb, ptep, address);	\
> +	} while (0)


It occurs to me that perhaps this can be written like:

	unsigned long _sz = huge_page_size(h);
	if (_sz >= P4D_SIZE)
		tlb_flush_p4d_range(tlb, address, _sz);
	else if (_sz >= PUD_SIZE)
		tlb_flush_pud_range(tlb, address, _sz);
	else if (_sz >= PMD_SIZE)
		tlb_flush_pmd_range(tlb, address, _sz);
	else
		tlb_flush_pte_range(tlb, address, _sz);
	__tlb_remove_tlb_entry(tlb, ptep, address);

And then it can still be generic..




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux