Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1615832

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

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] mm/vmalloc: allow to call vfree() in atomic context
Date 2017-04-04 11:50 +0200
Message-ID <tstg5-33o-1@gated-at.bofh.it> (permalink)
References <tqLTQ-1a6-25@gated-at.bofh.it> <tstg6-33o-3@gated-at.bofh.it> <tstg6-33o-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 30-03-17 17:48:39, Andrey Ryabinin wrote:
> From: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Subject: mm/vmalloc: allow to call vfree() in atomic context fix
> 
> Don't spawn worker if we already purging.
> 
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

I would rather put this into a separate patch. Ideally with some numners
as this is an optimization...

> ---
>  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);
>  }
>  
> -- 
> 2.10.2
> 

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/4] mm/vmalloc: allow to call vfree() in atomic context Michal Hocko <mhocko@kernel.org> - 2017-04-04 11:50 +0200
  Re: [PATCH 1/4] mm/vmalloc: allow to call vfree() in atomic context Michal Hocko <mhocko@kernel.org> - 2017-04-05 12:50 +0200

csiph-web