Thread (14 messages) 14 messages, 5 authors, 2021-06-29

Re: [PATCH] mm: vmalloc: add cond_resched() in __vunmap()

From: Aaron Tomlin <hidden>
Date: 2021-06-23 12:11:12
Also in: lkml

On Tue 2021-06-22 18:50 -0400, Rafael Aquini wrote:
quoted hunk ↗ jump to hunk
Like in other range zapping routines that iterate over
a large list, lets just add cond_resched() within __vunmap()'s
page-releasing loop in order to avoid the watchdog splats.

Signed-off-by: Rafael Aquini <redacted>
---
 mm/vmalloc.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index a13ac524f6ff..cd4b23d65748 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2564,6 +2564,7 @@ static void __vunmap(const void *addr, int deallocate_pages)
 
 			BUG_ON(!page);
 			__free_pages(page, page_order);
+			cond_resched();
 		}
 		atomic_long_sub(area->nr_pages, &nr_vmalloc_pages);
 
-- 
2.26.3
Good catch.

Reviewed-by: Aaron Tomlin <redacted>

-- 
Aaron Tomlin

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help