linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/vmalloc: use free_vm_area() if an allocation fails
@ 2020-11-16 22:00 Uladzislau Rezki (Sony)
  2020-11-16 22:00 ` [PATCH 2/2] mm/vmalloc: rework the drain logic Uladzislau Rezki (Sony)
  0 siblings, 1 reply; 14+ messages in thread
From: Uladzislau Rezki (Sony) @ 2020-11-16 22:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, LKML, Uladzislau Rezki, Hillf Danton, Michal Hocko,
	Matthew Wilcox, Oleksiy Avramchenko, Steven Rostedt

There is a dedicated and separate function that finds and
removes a continuous kernel virtual area. As a final step
it also releases the "area", a descriptor of corresponding
vm_struct.

Use free_vmap_area() in the __vmalloc_node_range() instead
of open coded steps which are exactly the same, to perform
a cleanup.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 mm/vmalloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index d7075ad340aa..b08b06a8cc2a 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2479,8 +2479,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 	}
 
 	if (!pages) {
-		remove_vm_area(area->addr);
-		kfree(area);
+		free_vm_area(area);
 		return NULL;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-11-25 20:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 22:00 [PATCH 1/2] mm/vmalloc: use free_vm_area() if an allocation fails Uladzislau Rezki (Sony)
2020-11-16 22:00 ` [PATCH 2/2] mm/vmalloc: rework the drain logic Uladzislau Rezki (Sony)
2020-11-17  2:37   ` huang ying
2020-11-17 13:04     ` Uladzislau Rezki
2020-11-18  2:44       ` huang ying
2020-11-18 16:16         ` Uladzislau Rezki
2020-11-19  1:40           ` Huang, Ying
2020-11-19 17:36             ` Uladzislau Rezki
2020-11-20  2:34               ` Huang, Ying
2020-11-23 13:59                 ` Uladzislau Rezki
2020-11-24  2:25                   ` Huang, Ying
2020-11-24 16:40                     ` Uladzislau Rezki
2020-11-25  0:52                       ` Huang, Ying
2020-11-25 20:34                         ` Uladzislau Rezki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).