linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Subject: Re: [PATCH 4/5] mm/vmalloc: Extend __find_vmap_area() with one more argument
Date: Wed, 8 Jun 2022 11:47:12 +0800	[thread overview]
Message-ID: <YqAbwC/evlFgMXuc@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20220607093449.3100-5-urezki@gmail.com>

On 06/07/22 at 11:34am, Uladzislau Rezki (Sony) wrote:
> __find_vmap_area() finds a "vmap_area" based on passed address.
> It scan the specific "vmap_area_root" rb-tree. Extend the function
> with one extra argument, so any tree can be specified where the
> search has to be done.
> 
> There is no functional change as a result of this patch.

LGTM,
Reviewed-by: Baoquan He <bhe@redhat.com>

> 
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> ---
>  mm/vmalloc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 82771e555273..b60385101897 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -814,9 +814,9 @@ static struct vmap_area *find_vmap_area_exceed_addr(unsigned long addr)
>  	return va;
>  }
>  
> -static struct vmap_area *__find_vmap_area(unsigned long addr)
> +static struct vmap_area *__find_vmap_area(unsigned long addr, struct rb_root *root)
>  {
> -	struct rb_node *n = vmap_area_root.rb_node;
> +	struct rb_node *n = root->rb_node;
>  
>  	addr = (unsigned long)kasan_reset_tag((void *)addr);
>  
> @@ -1840,7 +1840,7 @@ static struct vmap_area *find_vmap_area(unsigned long addr)
>  	struct vmap_area *va;
>  
>  	spin_lock(&vmap_area_lock);
> -	va = __find_vmap_area(addr);
> +	va = __find_vmap_area(addr, &vmap_area_root);
>  	spin_unlock(&vmap_area_lock);
>  
>  	return va;
> @@ -2582,7 +2582,7 @@ struct vm_struct *remove_vm_area(const void *addr)
>  	might_sleep();
>  
>  	spin_lock(&vmap_area_lock);
> -	va = __find_vmap_area((unsigned long)addr);
> +	va = __find_vmap_area((unsigned long)addr, &vmap_area_root);
>  	if (va && va->vm) {
>  		struct vm_struct *vm = va->vm;
>  
> -- 
> 2.30.2
> 
> 



  parent reply	other threads:[~2022-06-08  3:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  9:34 [PATCH 0/5] Reduce a vmalloc internal lock contention preparation work Uladzislau Rezki (Sony)
2022-06-07  9:34 ` [PATCH 1/5] mm/vmalloc: Make link_va()/unlink_va() common to different rb_root Uladzislau Rezki (Sony)
2022-06-08  3:45   ` Baoquan He
2022-06-07  9:34 ` [PATCH 2/5] mm/vmalloc: Extend __alloc_vmap_area() with extra arguments Uladzislau Rezki (Sony)
2022-06-07  9:49   ` Christoph Hellwig
2022-06-07 13:02     ` Uladzislau Rezki
2022-06-10  8:18       ` Christoph Hellwig
2022-06-08  3:46   ` Baoquan He
2022-06-07  9:34 ` [PATCH 3/5] mm/vmalloc: Initialize VA's list node after unlink Uladzislau Rezki (Sony)
2022-06-08  3:19   ` Baoquan He
2022-06-09 12:36     ` Uladzislau Rezki
2022-06-09 13:30       ` Baoquan He
2022-06-09 13:53         ` Uladzislau Rezki
2022-06-07  9:34 ` [PATCH 4/5] mm/vmalloc: Extend __find_vmap_area() with one more argument Uladzislau Rezki (Sony)
2022-06-07  9:47   ` Christoph Hellwig
2022-06-07 13:03     ` Uladzislau Rezki
2022-06-08  3:47   ` Baoquan He [this message]
2022-06-07  9:34 ` [PATCH 5/5] lib/test_vmalloc: Switch to prandom_u32() Uladzislau Rezki (Sony)
2022-06-07 22:35 ` [PATCH 0/5] Reduce a vmalloc internal lock contention preparation work Andrew Morton
2022-06-08 10:05   ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YqAbwC/evlFgMXuc@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=oleksiy.avramchenko@sony.com \
    --cc=urezki@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox