]> Gentwo Git Trees - linux/.git/commitdiff
io_uring/zcrx: use folio_nr_pages() instead of shift operation
authorPedro Demarchi Gomes <pedrodemargomes@gmail.com>
Thu, 13 Nov 2025 10:46:10 +0000 (10:46 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Nov 2025 18:19:37 +0000 (11:19 -0700)
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>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index 635ee4eb5d8d4d616737f28273f5f8706e3d2bb9..149bf9d5b98305ab2bf4331c55ed712f7a9e9e1e 100644 (file)
@@ -170,7 +170,7 @@ static unsigned long io_count_account_pages(struct page **pages, unsigned nr_pag
                if (folio == last_folio)
                        continue;
                last_folio = folio;
-               res += 1UL << folio_order(folio);
+               res += folio_nr_pages(folio);
        }
        return res;
 }