linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Remove the redundant conditional check
@ 2020-03-08  1:35 Baoquan He
  2020-03-10 10:10 ` Michal Hocko
  0 siblings, 1 reply; 5+ messages in thread
From: Baoquan He @ 2020-03-08  1:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm, akpm, mhocko, x86, bhe

In commit f70029bbaacbfa8f0 ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY, so the
conditional check in paging_init() doesn't make any sense any more.
Remove it.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 arch/x86/mm/init_64.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index abbdecb75fad..0a14711d3a93 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -818,8 +818,7 @@ void __init paging_init(void)
 	 *	 will not set it back.
 	 */
 	node_clear_state(0, N_MEMORY);
-	if (N_MEMORY != N_NORMAL_MEMORY)
-		node_clear_state(0, N_NORMAL_MEMORY);
+	node_clear_state(0, N_NORMAL_MEMORY);
 
 	zone_sizes_init();
 }
-- 
2.17.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/mm: Remove the redundant conditional check
  2020-03-08  1:35 [PATCH] x86/mm: Remove the redundant conditional check Baoquan He
@ 2020-03-10 10:10 ` Michal Hocko
  2020-03-10 14:23   ` Baoquan He
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Hocko @ 2020-03-10 10:10 UTC (permalink / raw)
  To: Baoquan He; +Cc: linux-kernel, linux-mm, akpm, x86

On Sun 08-03-20 09:35:11, Baoquan He wrote:
> In commit f70029bbaacbfa8f0 ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY, so the
> conditional check in paging_init() doesn't make any sense any more.
> Remove it.

Please expand more. I would really have to refresh the intention of the
code but from a quick look at the code CONFIG_HIGHMEM still makes
N_MEMORY != N_NORMAL_MEMORY. So what what does this change mean for that
config?

> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  arch/x86/mm/init_64.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index abbdecb75fad..0a14711d3a93 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -818,8 +818,7 @@ void __init paging_init(void)
>  	 *	 will not set it back.
>  	 */
>  	node_clear_state(0, N_MEMORY);
> -	if (N_MEMORY != N_NORMAL_MEMORY)
> -		node_clear_state(0, N_NORMAL_MEMORY);
> +	node_clear_state(0, N_NORMAL_MEMORY);
>  
>  	zone_sizes_init();
>  }
> -- 
> 2.17.2
> 

-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/mm: Remove the redundant conditional check
  2020-03-10 10:10 ` Michal Hocko
@ 2020-03-10 14:23   ` Baoquan He
  2020-03-10 14:32     ` Michal Hocko
  0 siblings, 1 reply; 5+ messages in thread
From: Baoquan He @ 2020-03-10 14:23 UTC (permalink / raw)
  To: Michal Hocko; +Cc: linux-kernel, linux-mm, akpm, x86

On 03/10/20 at 11:10am, Michal Hocko wrote:
> On Sun 08-03-20 09:35:11, Baoquan He wrote:
> > In commit f70029bbaacbfa8f0 ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> > the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY, so the
> > conditional check in paging_init() doesn't make any sense any more.
> > Remove it.
> 
> Please expand more. I would really have to refresh the intention of the
> code but from a quick look at the code CONFIG_HIGHMEM still makes
> N_MEMORY != N_NORMAL_MEMORY. So what what does this change mean for that
> config?

Thanks for looking into this. I was trying to explain that
CONFIG_MOVABLE_NODE made N_MEMORY have chance to take different enum
value.
 
Do you think the below saying is OK to you?
 
~~~
In commit f70029bbaacb ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY.  Before
commit f70029bbaacb, CONFIG_HIGHMEM && !CONFIG_MOVABLE_NODE could make
(N_MEMORY == N_NORMAL_MEMORY) be true. After commit f70029bbaacb, N_MEMORY
doesn't have any chance to be equal to N_NORMAL_MEMORY. So the  conditional
check in paging_init() doesn't make any sense any more. Let's remove it.
~~~
 
Thanks
Baoquan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/mm: Remove the redundant conditional check
  2020-03-10 14:23   ` Baoquan He
@ 2020-03-10 14:32     ` Michal Hocko
  2020-03-11  1:15       ` Baoquan He
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Hocko @ 2020-03-10 14:32 UTC (permalink / raw)
  To: Baoquan He; +Cc: linux-kernel, linux-mm, akpm, x86

On Tue 10-03-20 22:23:41, Baoquan He wrote:
> On 03/10/20 at 11:10am, Michal Hocko wrote:
> > On Sun 08-03-20 09:35:11, Baoquan He wrote:
> > > In commit f70029bbaacbfa8f0 ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> > > the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY, so the
> > > conditional check in paging_init() doesn't make any sense any more.
> > > Remove it.
> > 
> > Please expand more. I would really have to refresh the intention of the
> > code but from a quick look at the code CONFIG_HIGHMEM still makes
> > N_MEMORY != N_NORMAL_MEMORY. So what what does this change mean for that
> > config?
> 
> Thanks for looking into this. I was trying to explain that
> CONFIG_MOVABLE_NODE made N_MEMORY have chance to take different enum
> value.
>  
> Do you think the below saying is OK to you?
>  
> ~~~
> In commit f70029bbaacb ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY.  Before
> commit f70029bbaacb, CONFIG_HIGHMEM && !CONFIG_MOVABLE_NODE could make
> (N_MEMORY == N_NORMAL_MEMORY) be true. After commit f70029bbaacb, N_MEMORY
> doesn't have any chance to be equal to N_NORMAL_MEMORY. So the  conditional
> check in paging_init() doesn't make any sense any more. Let's remove it.

Yes this describes the matter much better. I have obviously misread the
code when looking at it this morning. Being explicit in the changelog
would have helped at least me. Thanks!

-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/mm: Remove the redundant conditional check
  2020-03-10 14:32     ` Michal Hocko
@ 2020-03-11  1:15       ` Baoquan He
  0 siblings, 0 replies; 5+ messages in thread
From: Baoquan He @ 2020-03-11  1:15 UTC (permalink / raw)
  To: Michal Hocko; +Cc: linux-kernel, linux-mm, akpm, x86

On 03/10/20 at 03:32pm, Michal Hocko wrote:
> On Tue 10-03-20 22:23:41, Baoquan He wrote:
> > On 03/10/20 at 11:10am, Michal Hocko wrote:
> > > On Sun 08-03-20 09:35:11, Baoquan He wrote:
> > > > In commit f70029bbaacbfa8f0 ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> > > > the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY, so the
> > > > conditional check in paging_init() doesn't make any sense any more.
> > > > Remove it.
> > > 
> > > Please expand more. I would really have to refresh the intention of the
> > > code but from a quick look at the code CONFIG_HIGHMEM still makes
> > > N_MEMORY != N_NORMAL_MEMORY. So what what does this change mean for that
> > > config?
> > 
> > Thanks for looking into this. I was trying to explain that
> > CONFIG_MOVABLE_NODE made N_MEMORY have chance to take different enum
> > value.
> >  
> > Do you think the below saying is OK to you?
> >  
> > ~~~
> > In commit f70029bbaacb ("mm, memory_hotplug: drop CONFIG_MOVABLE_NODE"),
> > the dependency on CONFIG_MOVABLE_NODE was removed for N_MEMORY.  Before
> > commit f70029bbaacb, CONFIG_HIGHMEM && !CONFIG_MOVABLE_NODE could make
> > (N_MEMORY == N_NORMAL_MEMORY) be true. After commit f70029bbaacb, N_MEMORY
> > doesn't have any chance to be equal to N_NORMAL_MEMORY. So the  conditional
> > check in paging_init() doesn't make any sense any more. Let's remove it.
> 
> Yes this describes the matter much better. I have obviously misread the
> code when looking at it this morning. Being explicit in the changelog
> would have helped at least me. Thanks!

Will update log and repost, thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-11  1:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-08  1:35 [PATCH] x86/mm: Remove the redundant conditional check Baoquan He
2020-03-10 10:10 ` Michal Hocko
2020-03-10 14:23   ` Baoquan He
2020-03-10 14:32     ` Michal Hocko
2020-03-11  1:15       ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).