* [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function
@ 2023-03-31 7:37 Uladzislau Rezki (Sony)
2023-03-31 8:38 ` Lorenzo Stoakes
2023-03-31 11:46 ` Baoquan He
0 siblings, 2 replies; 4+ messages in thread
From: Uladzislau Rezki (Sony) @ 2023-03-31 7:37 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, LKML, Baoquan He, Lorenzo Stoakes, Christoph Hellwig,
Matthew Wilcox, Dave Chinner, Uladzislau Rezki,
Oleksiy Avramchenko
Short the name of the addr_to_vb_xarray() function to the
addr_to_vb_xa(). This aligns with other internal function
abbreviations.
Suggested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
mm/vmalloc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 671d6d5d5b78..b8b646f8a00d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1945,7 +1945,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
* used as a hash table. When used as a hash a 'cpu' passed to
* per_cpu() is not actually a CPU but rather a hash index.
*
- * A hash function is addr_to_vb_xarray() which hashes any address
+ * A hash function is addr_to_vb_xa() which hashes any address
* to a specific index(in a hash) it belongs to. This then uses a
* per_cpu() macro to access an array with generated index.
*
@@ -1971,7 +1971,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
* however xarray spinlocks protect against any contention that remains.
*/
static struct xarray *
-addr_to_vb_xarray(unsigned long addr)
+addr_to_vb_xa(unsigned long addr)
{
int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
@@ -2048,7 +2048,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
bitmap_set(vb->used_map, 0, (1UL << order));
INIT_LIST_HEAD(&vb->free_list);
- xa = addr_to_vb_xarray(va->va_start);
+ xa = addr_to_vb_xa(va->va_start);
vb_idx = addr_to_vb_idx(va->va_start);
err = xa_insert(xa, vb_idx, vb, gfp_mask);
if (err) {
@@ -2070,7 +2070,7 @@ static void free_vmap_block(struct vmap_block *vb)
struct vmap_block *tmp;
struct xarray *xa;
- xa = addr_to_vb_xarray(vb->va->va_start);
+ xa = addr_to_vb_xa(vb->va->va_start);
tmp = xa_erase(xa, addr_to_vb_idx(vb->va->va_start));
BUG_ON(tmp != vb);
@@ -2193,7 +2193,7 @@ static void vb_free(unsigned long addr, unsigned long size)
order = get_order(size);
offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
- xa = addr_to_vb_xarray(addr);
+ xa = addr_to_vb_xa(addr);
vb = xa_load(xa, addr_to_vb_idx(addr));
spin_lock(&vb->lock);
@@ -3556,7 +3556,7 @@ static void vmap_ram_vread(char *buf, char *addr, int count, unsigned long flags
* Area is split into regions and tracked with vmap_block, read out
* each region and zero fill the hole between regions.
*/
- xa = addr_to_vb_xarray((unsigned long) addr);
+ xa = addr_to_vb_xa((unsigned long) addr);
vb = xa_load(xa, addr_to_vb_idx((unsigned long)addr));
if (!vb)
goto finished;
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function
2023-03-31 7:37 [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function Uladzislau Rezki (Sony)
@ 2023-03-31 8:38 ` Lorenzo Stoakes
2023-03-31 10:04 ` Uladzislau Rezki
2023-03-31 11:46 ` Baoquan He
1 sibling, 1 reply; 4+ messages in thread
From: Lorenzo Stoakes @ 2023-03-31 8:38 UTC (permalink / raw)
To: Uladzislau Rezki (Sony)
Cc: Andrew Morton, linux-mm, LKML, Baoquan He, Christoph Hellwig,
Matthew Wilcox, Dave Chinner, Oleksiy Avramchenko
On Fri, Mar 31, 2023 at 09:37:27AM +0200, Uladzislau Rezki (Sony) wrote:
> Short the name of the addr_to_vb_xarray() function to the
> addr_to_vb_xa(). This aligns with other internal function
> abbreviations.
>
> Suggested-by: Baoquan He <bhe@redhat.com>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> ---
> mm/vmalloc.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 671d6d5d5b78..b8b646f8a00d 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1945,7 +1945,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> * used as a hash table. When used as a hash a 'cpu' passed to
> * per_cpu() is not actually a CPU but rather a hash index.
> *
> - * A hash function is addr_to_vb_xarray() which hashes any address
> + * A hash function is addr_to_vb_xa() which hashes any address
> * to a specific index(in a hash) it belongs to. This then uses a
> * per_cpu() macro to access an array with generated index.
> *
> @@ -1971,7 +1971,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> * however xarray spinlocks protect against any contention that remains.
> */
> static struct xarray *
> -addr_to_vb_xarray(unsigned long addr)
> +addr_to_vb_xa(unsigned long addr)
> {
> int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
>
> @@ -2048,7 +2048,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
> bitmap_set(vb->used_map, 0, (1UL << order));
> INIT_LIST_HEAD(&vb->free_list);
>
> - xa = addr_to_vb_xarray(va->va_start);
> + xa = addr_to_vb_xa(va->va_start);
> vb_idx = addr_to_vb_idx(va->va_start);
> err = xa_insert(xa, vb_idx, vb, gfp_mask);
> if (err) {
> @@ -2070,7 +2070,7 @@ static void free_vmap_block(struct vmap_block *vb)
> struct vmap_block *tmp;
> struct xarray *xa;
>
> - xa = addr_to_vb_xarray(vb->va->va_start);
> + xa = addr_to_vb_xa(vb->va->va_start);
> tmp = xa_erase(xa, addr_to_vb_idx(vb->va->va_start));
> BUG_ON(tmp != vb);
>
> @@ -2193,7 +2193,7 @@ static void vb_free(unsigned long addr, unsigned long size)
> order = get_order(size);
> offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
>
> - xa = addr_to_vb_xarray(addr);
> + xa = addr_to_vb_xa(addr);
> vb = xa_load(xa, addr_to_vb_idx(addr));
>
> spin_lock(&vb->lock);
> @@ -3556,7 +3556,7 @@ static void vmap_ram_vread(char *buf, char *addr, int count, unsigned long flags
> * Area is split into regions and tracked with vmap_block, read out
> * each region and zero fill the hole between regions.
> */
> - xa = addr_to_vb_xarray((unsigned long) addr);
> + xa = addr_to_vb_xa((unsigned long) addr);
> vb = xa_load(xa, addr_to_vb_idx((unsigned long)addr));
> if (!vb)
> goto finished;
> --
> 2.30.2
>
I have no problem with this patch but it's a bit of a pain to apply, as
doesn't apply to mm-unstable or -next as it doesn't take into account my
vread_iter changes, however Andrew can probably figure it out :)
I checked it manually and it's fine, so:-
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function
2023-03-31 8:38 ` Lorenzo Stoakes
@ 2023-03-31 10:04 ` Uladzislau Rezki
0 siblings, 0 replies; 4+ messages in thread
From: Uladzislau Rezki @ 2023-03-31 10:04 UTC (permalink / raw)
To: Lorenzo Stoakes
Cc: Uladzislau Rezki (Sony),
Andrew Morton, linux-mm, LKML, Baoquan He, Christoph Hellwig,
Matthew Wilcox, Dave Chinner, Oleksiy Avramchenko
On Fri, Mar 31, 2023 at 09:38:49AM +0100, Lorenzo Stoakes wrote:
> On Fri, Mar 31, 2023 at 09:37:27AM +0200, Uladzislau Rezki (Sony) wrote:
> > Short the name of the addr_to_vb_xarray() function to the
> > addr_to_vb_xa(). This aligns with other internal function
> > abbreviations.
> >
> > Suggested-by: Baoquan He <bhe@redhat.com>
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> > ---
> > mm/vmalloc.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > index 671d6d5d5b78..b8b646f8a00d 100644
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> > @@ -1945,7 +1945,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> > * used as a hash table. When used as a hash a 'cpu' passed to
> > * per_cpu() is not actually a CPU but rather a hash index.
> > *
> > - * A hash function is addr_to_vb_xarray() which hashes any address
> > + * A hash function is addr_to_vb_xa() which hashes any address
> > * to a specific index(in a hash) it belongs to. This then uses a
> > * per_cpu() macro to access an array with generated index.
> > *
> > @@ -1971,7 +1971,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> > * however xarray spinlocks protect against any contention that remains.
> > */
> > static struct xarray *
> > -addr_to_vb_xarray(unsigned long addr)
> > +addr_to_vb_xa(unsigned long addr)
> > {
> > int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
> >
> > @@ -2048,7 +2048,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
> > bitmap_set(vb->used_map, 0, (1UL << order));
> > INIT_LIST_HEAD(&vb->free_list);
> >
> > - xa = addr_to_vb_xarray(va->va_start);
> > + xa = addr_to_vb_xa(va->va_start);
> > vb_idx = addr_to_vb_idx(va->va_start);
> > err = xa_insert(xa, vb_idx, vb, gfp_mask);
> > if (err) {
> > @@ -2070,7 +2070,7 @@ static void free_vmap_block(struct vmap_block *vb)
> > struct vmap_block *tmp;
> > struct xarray *xa;
> >
> > - xa = addr_to_vb_xarray(vb->va->va_start);
> > + xa = addr_to_vb_xa(vb->va->va_start);
> > tmp = xa_erase(xa, addr_to_vb_idx(vb->va->va_start));
> > BUG_ON(tmp != vb);
> >
> > @@ -2193,7 +2193,7 @@ static void vb_free(unsigned long addr, unsigned long size)
> > order = get_order(size);
> > offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
> >
> > - xa = addr_to_vb_xarray(addr);
> > + xa = addr_to_vb_xa(addr);
> > vb = xa_load(xa, addr_to_vb_idx(addr));
> >
> > spin_lock(&vb->lock);
> > @@ -3556,7 +3556,7 @@ static void vmap_ram_vread(char *buf, char *addr, int count, unsigned long flags
> > * Area is split into regions and tracked with vmap_block, read out
> > * each region and zero fill the hole between regions.
> > */
> > - xa = addr_to_vb_xarray((unsigned long) addr);
> > + xa = addr_to_vb_xa((unsigned long) addr);
> > vb = xa_load(xa, addr_to_vb_idx((unsigned long)addr));
> > if (!vb)
> > goto finished;
> > --
> > 2.30.2
> >
>
> I have no problem with this patch but it's a bit of a pain to apply, as
> doesn't apply to mm-unstable or -next as it doesn't take into account my
> vread_iter changes, however Andrew can probably figure it out :)
>
> I checked it manually and it's fine, so:-
>
> Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
>
Thanks! I based it on next-20230317. If Andrew has some issues with it
i will resend it on a latest tip!
--
Uladzislau Rezki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function
2023-03-31 7:37 [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function Uladzislau Rezki (Sony)
2023-03-31 8:38 ` Lorenzo Stoakes
@ 2023-03-31 11:46 ` Baoquan He
1 sibling, 0 replies; 4+ messages in thread
From: Baoquan He @ 2023-03-31 11:46 UTC (permalink / raw)
To: Uladzislau Rezki (Sony)
Cc: Andrew Morton, linux-mm, LKML, Lorenzo Stoakes,
Christoph Hellwig, Matthew Wilcox, Dave Chinner,
Oleksiy Avramchenko
On 03/31/23 at 09:37am, Uladzislau Rezki (Sony) wrote:
> Short the name of the addr_to_vb_xarray() function to the
> addr_to_vb_xa(). This aligns with other internal function
> abbreviations.
>
> Suggested-by: Baoquan He <bhe@redhat.com>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> ---
> mm/vmalloc.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 671d6d5d5b78..b8b646f8a00d 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1945,7 +1945,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> * used as a hash table. When used as a hash a 'cpu' passed to
> * per_cpu() is not actually a CPU but rather a hash index.
> *
> - * A hash function is addr_to_vb_xarray() which hashes any address
> + * A hash function is addr_to_vb_xa() which hashes any address
> * to a specific index(in a hash) it belongs to. This then uses a
> * per_cpu() macro to access an array with generated index.
> *
> @@ -1971,7 +1971,7 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
> * however xarray spinlocks protect against any contention that remains.
> */
> static struct xarray *
> -addr_to_vb_xarray(unsigned long addr)
> +addr_to_vb_xa(unsigned long addr)
> {
> int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
>
> @@ -2048,7 +2048,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)
> bitmap_set(vb->used_map, 0, (1UL << order));
> INIT_LIST_HEAD(&vb->free_list);
>
> - xa = addr_to_vb_xarray(va->va_start);
> + xa = addr_to_vb_xa(va->va_start);
> vb_idx = addr_to_vb_idx(va->va_start);
> err = xa_insert(xa, vb_idx, vb, gfp_mask);
> if (err) {
> @@ -2070,7 +2070,7 @@ static void free_vmap_block(struct vmap_block *vb)
> struct vmap_block *tmp;
> struct xarray *xa;
>
> - xa = addr_to_vb_xarray(vb->va->va_start);
> + xa = addr_to_vb_xa(vb->va->va_start);
> tmp = xa_erase(xa, addr_to_vb_idx(vb->va->va_start));
> BUG_ON(tmp != vb);
>
> @@ -2193,7 +2193,7 @@ static void vb_free(unsigned long addr, unsigned long size)
> order = get_order(size);
> offset = (addr & (VMAP_BLOCK_SIZE - 1)) >> PAGE_SHIFT;
>
> - xa = addr_to_vb_xarray(addr);
> + xa = addr_to_vb_xa(addr);
> vb = xa_load(xa, addr_to_vb_idx(addr));
>
> spin_lock(&vb->lock);
> @@ -3556,7 +3556,7 @@ static void vmap_ram_vread(char *buf, char *addr, int count, unsigned long flags
> * Area is split into regions and tracked with vmap_block, read out
> * each region and zero fill the hole between regions.
> */
> - xa = addr_to_vb_xarray((unsigned long) addr);
> + xa = addr_to_vb_xa((unsigned long) addr);
> vb = xa_load(xa, addr_to_vb_idx((unsigned long)addr));
> if (!vb)
> goto finished;
Reviewed-by: Baoquan He <bhe@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-31 11:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 7:37 [PATCH 1/1] mm: vmalloc: Rename addr_to_vb_xarray() function Uladzislau Rezki (Sony)
2023-03-31 8:38 ` Lorenzo Stoakes
2023-03-31 10:04 ` Uladzislau Rezki
2023-03-31 11:46 ` Baoquan He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox