io_uring/zcrx: use folio_nr_pages() instead of shift operation
Subsystems (2)
PATCH 1/1 io_uring/zcrx: 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]>
--- io_uring/zcrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/zcrx.c +1 -1
@@ -172,7 +172,7 @@ static unsigned long io_count_account_pages(struct page **pages, unsigned nr_pagif (folio == last_folio)continue ; last_folio = folio; - res +=1UL <<folio_order (folio); + res +=folio_nr_pages (folio); }return res; }
Signature · 1 line
2.39.5
Pavel Begunkov
maintainerQuoted 2 lines · Pedro Demarchi Gomes
folio_nr_pages()is a faster helper function to get the number of pages whenNR_PAGES_IN_LARGE_FOLIOis enabled.
Looks straightforward, I'll take it into a branch.
Quoted 18 lines
Signed-off-by Pedro Demarchi Gomes <[email protected]>--- io_uring/zcrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)io_uring/zcrx.c +1
-1@@ -172,7 +172,7 @@ static unsigned long io_count_account_pages(struct page **pages, unsigned nr_pagif (folio == last_folio)continue ; last_folio = folio; - res +=1UL <<folio_order (folio); + res +=folio_nr_pages (folio); }return res; }
Signature · 1 line
Pavel Begunkov