iommu/pages: use folio_nr_pages() instead of shift operation
PATCH 1/1 iommu/pages: use folio_nr_pages() instead of shift operation
folio_nr_pages() is a faster helper function to get the number of pages when NR_PAGES_IN_LARGE_FOLIO is enabled.
Signed-off-by Pedro Demarchi Gomes <[email protected]>
--- drivers/iommu/iommu-pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/iommu-pages.c +1 -1
@@ -80,7 +80,7 @@ EXPORT_SYMBOL_GPL(iommu_alloc_pages_node_sz);static void __iommu_free_desc (struct ioptdesc *iopt) {struct folio *folio =ioptdesc_folio (iopt); -const unsigned long pgcnt =1UL <<folio_order (folio); +const unsigned long pgcnt =folio_nr_pages (folio);mod_node_page_state (folio_pgdat (folio),NR_IOMMU_PAGES , -pgcnt);lruvec_stat_mod_folio (folio,NR_SECONDARY_PAGETABLE , -pgcnt);
Signature · 1 line
2.39.5
Quoted 7 lines · Pedro Demarchi Gomes
folio_nr_pages()is a faster helper function to get the number of pages whenNR_PAGES_IN_LARGE_FOLIOis enabled.Signed-off-by Pedro Demarchi Gomes <[email protected]>--- drivers/iommu/iommu-pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Jason Gunthorpe <[email protected]>
Jason
Quoted 7 lines · Pedro Demarchi Gomes
folio_nr_pages()is a faster helper function to get the number of pages whenNR_PAGES_IN_LARGE_FOLIOis enabled.Signed-off-by Pedro Demarchi Gomes <[email protected]>--- drivers/iommu/iommu-pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.