* [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation
@ 2025-10-04 3:23 Pedro Demarchi Gomes
2025-10-06 12:28 ` Jason Gunthorpe
2025-10-27 11:47 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Pedro Demarchi Gomes @ 2025-10-04 3:23 UTC (permalink / raw)
To: Joerg Roedel, Will Deacon
Cc: Robin Murphy, iommu, linux-kernel, Pedro Demarchi Gomes
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@gmail.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation
2025-10-04 3:23 [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation Pedro Demarchi Gomes
@ 2025-10-06 12:28 ` Jason Gunthorpe
2025-10-27 11:47 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2025-10-06 12:28 UTC (permalink / raw)
To: Pedro Demarchi Gomes
Cc: Joerg Roedel, Will Deacon, Robin Murphy, iommu, linux-kernel
On Sat, Oct 04, 2025 at 12:23:51AM -0300, Pedro Demarchi Gomes wrote:
> 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@gmail.com>
> ---
> drivers/iommu/iommu-pages.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation
2025-10-04 3:23 [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation Pedro Demarchi Gomes
2025-10-06 12:28 ` Jason Gunthorpe
@ 2025-10-27 11:47 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2025-10-27 11:47 UTC (permalink / raw)
To: Pedro Demarchi Gomes; +Cc: Will Deacon, Robin Murphy, iommu, linux-kernel
On Sat, Oct 04, 2025 at 12:23:51AM -0300, Pedro Demarchi Gomes wrote:
> 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@gmail.com>
> ---
> drivers/iommu/iommu-pages.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-27 11:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-04 3:23 [PATCH] iommu/pages: use folio_nr_pages() instead of shift operation Pedro Demarchi Gomes
2025-10-06 12:28 ` Jason Gunthorpe
2025-10-27 11:47 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox