linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Baoquan He <bhe@redhat.com>, liuye <liuye@kylinos.cn>
Cc: liuye <liuye@kylinos.cn>, Uladzislau Rezki <urezki@gmail.com>,
	akpm@linux-foundation.org, hch@infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] mm/vmalloc: Remove unnecessary size ALIGN in __vmalloc_node_range_noprof
Date: Wed, 5 Mar 2025 11:06:46 +0100	[thread overview]
Message-ID: <Z8giNq5CMtbYnlo-@pc636> (raw)
In-Reply-To: <Z8ghK22l7USzuBWY@MiWiFi-R3L-srv>

On Wed, Mar 05, 2025 at 06:02:19PM +0800, Baoquan He wrote:
> On 03/05/25 at 09:46am, liuye wrote:
> > 
> > 在 2025/3/4 02:30, Uladzislau Rezki 写道:
> > > On Mon, Mar 03, 2025 at 05:44:07PM +0800, Liu Ye wrote:
> > >> The same operation already exists in the function __get_vm_area_node,
> > >> so delete the duplicate operation to simplify the code.
> > >>
> > >> Signed-off-by: Liu Ye <liuye@kylinos.cn>
> > >> ---
> > >>  mm/vmalloc.c | 1 -
> > >>  1 file changed, 1 deletion(-)
> > >>
> > >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > >> index dc658d4af181..20d9b9de84b1 100644
> > >> --- a/mm/vmalloc.c
> > >> +++ b/mm/vmalloc.c
> > >> @@ -3798,7 +3798,6 @@ void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align,
> > >>  			shift = arch_vmap_pte_supported_shift(size);
> > >>  
> > >>  		align = max(real_align, 1UL << shift);
> > >> -		size = ALIGN(real_size, 1UL << shift);
> > >>  	}
> > >>  
> > >>  again:
> > >> -- 
> > >> 2.25.1
> > >>
> > > There is a mess with:
> > >
> > >  unsigned long real_size = size;
> > >  unsigned long real_align = align;
> > >
> > > "real_size" and "real_align". Those are useless. What is about:
> > 
> > Sorry, the order of the patches may be misleading.
> > 
> > The correct order is as follows:
> > 
> > PATCH1.  mm/vmalloc: Size should be used instead of real_size "
> > PATCH2.  mm/vmalloc: Remove unnecessary size ALIGN in __vmalloc_node_range_noprof                 
> > PATCH3.  mm/vmalloc: Remove the real_size variable to simplify the code "
> > PATCH4.  mm/vmalloc: Rename the variable real_align to original_align to prevent misunderstanding
> > 
> > If PATCH1 is the correct fix, then consider PATCH2, PATCH3, and PATCH4.
> 
> Well, seems the patch split is done too subtly. It's only about the
> size/align inside one function, maybe one patch is enough in this case.
> My personal opinion.
> 
I agree. One patch would be enough.

--
Uladzislau Rezki


  reply	other threads:[~2025-03-05 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03  9:44 [PATCH 0/4] Optimize __vmalloc_node_range_noprof function Liu Ye
2025-03-03  9:44 ` [PATCH 1/4] mm/vmalloc: Remove unnecessary size ALIGN in __vmalloc_node_range_noprof Liu Ye
2025-03-03 18:30   ` Uladzislau Rezki
2025-03-05  1:46     ` liuye
2025-03-05 10:02       ` Baoquan He
2025-03-05 10:06         ` Uladzislau Rezki [this message]
2025-03-06  1:32           ` liuye
2025-03-03  9:44 ` [PATCH 2/4] mm/vmalloc: Size should be used instead of real_size " Liu Ye
2025-03-03  9:44 ` [PATCH 3/4] mm/vmalloc: Remove the real_size variable to simplify the code " Liu Ye
2025-03-03  9:44 ` [PATCH 4/4] mm/vmalloc: Rename the variable real_align to original_align to prevent misunderstanding Liu Ye
2025-03-03 16:09 ` [PATCH 0/4] Optimize __vmalloc_node_range_noprof function Uladzislau Rezki
2025-03-04  5:58   ` Dev Jain
2025-03-05  1:33     ` liuye

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=Z8giNq5CMtbYnlo-@pc636 \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuye@kylinos.cn \
    /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