lkml.org 
[lkml]   [2020]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] mm/vmalloc: make sure to traverse from the beginning when overflow occur
From
Date
On 4/12/20 7:38 AM, Liu Song wrote:
> If overflow, should ensure that "free_vmap_cache" is set to NULL,
> so as to ensure that it can be traversed from the beginning.

This changelog is a bit sparse.

Does this fix a demonstrated problem? Or was it just discovered via
code review and assumed to help a theoretical problem?

Which tree is it against? 'free_vmap_cache' doesn't show up in Linus's
tree.
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index d8e877365f9f..2638a20d36ce 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -441,7 +441,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
> if (!free_vmap_cache ||
> size < cached_hole_size ||
> vstart < cached_vstart ||
> - align < cached_align) {
> + align < cached_align || purged) {
> nocache:
> cached_hole_size = 0;
> free_vmap_cache = NULL;

Is 'purged' the right way to do this?

There is a path through the overflow code that also sets purged=0. Does
'free_vmap_cache' *not* need to get reset in that case?

It also seems more natural to me that the code mucking with the rbtree
would be the one to reset the cache.

\
 
 \ /
  Last update: 2020-04-13 17:03    [W:0.081 / U:1.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site