Commit 99a9e0b8 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

io_uring: stop calling free_compound_page()

Patch series "Remove _folio_dtor and _folio_order", v2.


This patch (of 13):

folio_put() is the standard way to write this, and it's not appreciably
slower.  This is an enabling patch for removing free_compound_page()
entirely.

Link: https://lkml.kernel.org/r/20230816151201.3655946-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20230816151201.3655946-2-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent e5013f11
...@@ -2643,14 +2643,10 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, ...@@ -2643,14 +2643,10 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
static void io_mem_free(void *ptr) static void io_mem_free(void *ptr)
{ {
struct page *page;
if (!ptr) if (!ptr)
return; return;
page = virt_to_head_page(ptr); folio_put(virt_to_folio(ptr));
if (put_page_testzero(page))
free_compound_page(page);
} }
static void io_pages_free(struct page ***pages, int npages) static void io_pages_free(struct page ***pages, int npages)
......
...@@ -218,11 +218,7 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx, ...@@ -218,11 +218,7 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx,
if (bl->is_mapped) { if (bl->is_mapped) {
i = bl->buf_ring->tail - bl->head; i = bl->buf_ring->tail - bl->head;
if (bl->is_mmap) { if (bl->is_mmap) {
struct page *page; folio_put(virt_to_folio(bl->buf_ring));
page = virt_to_head_page(bl->buf_ring);
if (put_page_testzero(page))
free_compound_page(page);
bl->buf_ring = NULL; bl->buf_ring = NULL;
bl->is_mmap = 0; bl->is_mmap = 0;
} else if (bl->buf_nr_pages) { } else if (bl->buf_nr_pages) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment