[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6RsmcvZ8Ru211Jk@pc636>
Date: Thu, 22 Dec 2022 15:41:29 +0100
From: Uladzislau Rezki <urezki@...il.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: "Uladzislau Rezki (Sony)" <urezki@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>, Baoquan He <bhe@...hat.com>,
Lorenzo Stoakes <lstoakes@...il.com>,
Matthew Wilcox <willy@...radead.org>,
Nicholas Piggin <npiggin@...il.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@...y.com>,
Roman Gushchin <roman.gushchin@...ux.dev>
Subject: Re: [PATCH v2 1/3] mm: vmalloc: Avoid of calling __find_vmap_area()
twise in __vunmap()
> A sorry. I need more coffee, this is not the cover letter, but the
> patch that introduceѕ find_unlink_vmap_area.
>
Sorry. I should post it with a cover latter to make it less confusing.
> > - spin_lock(&vmap_area_lock);
> > - unlink_va(va, &vmap_area_root);
> > - spin_unlock(&vmap_area_lock);
> > + if (!list_empty(&va->list)) {
> > + spin_lock(&vmap_area_lock);
> > + unlink_va(va, &vmap_area_root);
> > + spin_unlock(&vmap_area_lock);
> > + }
>
> As mentioned before, I'd much rather move this into the callers.
>
Agree. There is only one caller, it is the free_vmap_block().
Will fix in the v3.
> > + va = find_unlink_vmap_area((unsigned long) addr);
> > + return __remove_vm_area(va);
>
> This can drop the va local variable now.
>
Do you mean like:
struct vm_struct *remove_vm_area(const void *addr)
{
might_sleep();
return __remove_vm_area(
find_unlink_vmap_area((unsigned long) addr));
}
?
Thanks for review!
--
Uladzislau Rezki
Powered by blists - more mailing lists