lkml.org 
[lkml]   [2020]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] vmalloc: Free pages as a batch
Date
Use release_pages() to free the pages allocated by vmalloc().  This is
slightly more efficient in terms of disabling and enabling IRQs once
per batch instead of once per page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
mm/vmalloc.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index be4724b916b3..3893fc8915c4 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2263,16 +2263,8 @@ static void __vunmap(const void *addr, int deallocate_pages)
vm_remove_mappings(area, deallocate_pages);

if (deallocate_pages) {
- int i;
-
- for (i = 0; i < area->nr_pages; i++) {
- struct page *page = area->pages[i];
-
- BUG_ON(!page);
- __free_pages(page, 0);
- }
+ release_pages(area->pages, area->nr_pages);
atomic_long_sub(area->nr_pages, &nr_vmalloc_pages);
-
kvfree(area->pages);
}

--
2.28.0
\
 
 \ /
  Last update: 2020-09-22 00:47    [W:0.101 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site