Thread (28 messages) 28 messages, 8 authors, 2017-04-12

Re: [PATCH 1/4] mm/vmalloc: allow to call vfree() in atomic context

From: Thomas Hellstrom <hidden>
Date: 2017-03-30 15:04:47
Also in: lkml, stable

On 03/30/2017 04:48 PM, Andrey Ryabinin wrote:
quoted hunk ↗ jump to hunk
On 03/30/2017 03:00 PM, Thomas Hellstrom wrote:
quoted
quoted
 
 	if (unlikely(nr_lazy > lazy_max_pages()))
-		try_purge_vmap_area_lazy();
Perhaps a slight optimization would be to schedule work iff
!mutex_locked(&vmap_purge_lock) below?
Makes sense, we don't need to spawn workers if we already purging.



From: Andrey Ryabinin <redacted>
Subject: mm/vmalloc: allow to call vfree() in atomic context fix

Don't spawn worker if we already purging.

Signed-off-by: Andrey Ryabinin <redacted>
---
 mm/vmalloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ea1b4ab..88168b8 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -737,7 +737,8 @@ static void free_vmap_area_noflush(struct vmap_area *va)
 	/* After this point, we may free va at any time */
 	llist_add(&va->purge_list, &vmap_purge_list);
 
-	if (unlikely(nr_lazy > lazy_max_pages()))
+	if (unlikely(nr_lazy > lazy_max_pages()) &&
+	    !mutex_is_locked(&vmap_purge_lock))
 		schedule_work(&purge_vmap_work);
 }
 
For both patches,

Reviewed-by: Thomas Hellstrom <redacted>

Thanks,

Thomas


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help