[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251004032351.51150-1-pedrodemargomes@gmail.com>
Date: Sat, 4 Oct 2025 00:23:51 -0300
From: Pedro Demarchi Gomes <pedrodemargomes@...il.com>
To: Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>
Cc: Robin Murphy <robin.murphy@....com>,
iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Pedro Demarchi Gomes <pedrodemargomes@...il.com>
Subject: [PATCH] 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 <pedrodemargomes@...il.com>
---
drivers/iommu/iommu-pages.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/iommu-pages.c b/drivers/iommu/iommu-pages.c
index 238c09e5166b..3cb8fcc39066 100644
--- a/drivers/iommu/iommu-pages.c
+++ b/drivers/iommu/iommu-pages.c
@@ -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);
--
2.39.5
Powered by blists - more mailing lists