diff mbox series

[v3,4/6] mm: Demote warning message in vmemmap_verify() to debug level

Message ID 20220607093805.1354256-5-mawupeng1@huawei.com (mailing list archive)
State New
Headers show
Series introduce mirrored memory support for arm64 | expand

Commit Message

mawupeng June 7, 2022, 9:38 a.m. UTC
From: Ma Wupeng <mawupeng1@huawei.com>

For a system only have limited mirrored memory or some numa node without
mirrored memory, the per node vmemmap page_structs prefer to allocate
memory from mirrored region, which will lead to vmemmap_verify() in
vmemmap_populate_basepages() report lots of warning message.

This patch demote the "potential offnode page_structs" warning messages
to debug level to avoid a very long print during bootup.

Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
---
 mm/sparse-vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand June 7, 2022, 12:25 p.m. UTC | #1
On 07.06.22 11:38, Wupeng Ma wrote:
> From: Ma Wupeng <mawupeng1@huawei.com>
> 
> For a system only have limited mirrored memory or some numa node without
> mirrored memory, the per node vmemmap page_structs prefer to allocate
> memory from mirrored region, which will lead to vmemmap_verify() in
> vmemmap_populate_basepages() report lots of warning message.
> 
> This patch demote the "potential offnode page_structs" warning messages
> to debug level to avoid a very long print during bootup.
> 
> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
> ---
>  mm/sparse-vmemmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
> index f4fa61dbbee3..78debdb89eb1 100644
> --- a/mm/sparse-vmemmap.c
> +++ b/mm/sparse-vmemmap.c
> @@ -528,7 +528,7 @@ void __meminit vmemmap_verify(pte_t *pte, int node,
>  	int actual_node = early_pfn_to_nid(pfn);
>  
>  	if (node_distance(actual_node, node) > LOCAL_DISTANCE)
> -		pr_warn("[%lx-%lx] potential offnode page_structs\n",
> +		pr_debug("[%lx-%lx] potential offnode page_structs\n",
>  			start, end - 1);
>  }
>  

This will possibly hide it in environments where this might indeed
indicate performance issues.

What about a pr_warn_once()?
mawupeng June 8, 2022, 1:26 a.m. UTC | #2
在 2022/6/7 20:25, David Hildenbrand 写道:
> On 07.06.22 11:38, Wupeng Ma wrote:
>> From: Ma Wupeng <mawupeng1@huawei.com>
>>
>> For a system only have limited mirrored memory or some numa node without
>> mirrored memory, the per node vmemmap page_structs prefer to allocate
>> memory from mirrored region, which will lead to vmemmap_verify() in
>> vmemmap_populate_basepages() report lots of warning message.
>>
>> This patch demote the "potential offnode page_structs" warning messages
>> to debug level to avoid a very long print during bootup.
>>
>> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
>> ---
>>   mm/sparse-vmemmap.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
>> index f4fa61dbbee3..78debdb89eb1 100644
>> --- a/mm/sparse-vmemmap.c
>> +++ b/mm/sparse-vmemmap.c
>> @@ -528,7 +528,7 @@ void __meminit vmemmap_verify(pte_t *pte, int node,
>>   	int actual_node = early_pfn_to_nid(pfn);
>>   
>>   	if (node_distance(actual_node, node) > LOCAL_DISTANCE)
>> -		pr_warn("[%lx-%lx] potential offnode page_structs\n",
>> +		pr_debug("[%lx-%lx] potential offnode page_structs\n",
>>   			start, end - 1);
>>   }
>>   
> 
> This will possibly hide it in environments where this might indeed
> indicate performance issues.
> 
> What about a pr_warn_once()?
> 

Sure.

This will works. We can certainly use a pr_warn_once().
Anshuman Khandual June 8, 2022, 10 a.m. UTC | #3
On 6/8/22 06:56, mawupeng wrote:
> 
> 
> 在 2022/6/7 20:25, David Hildenbrand 写道:
>> On 07.06.22 11:38, Wupeng Ma wrote:
>>> From: Ma Wupeng <mawupeng1@huawei.com>
>>>
>>> For a system only have limited mirrored memory or some numa node without
>>> mirrored memory, the per node vmemmap page_structs prefer to allocate
>>> memory from mirrored region, which will lead to vmemmap_verify() in
>>> vmemmap_populate_basepages() report lots of warning message.
>>>
>>> This patch demote the "potential offnode page_structs" warning messages
>>> to debug level to avoid a very long print during bootup.
>>>
>>> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
>>> ---
>>>   mm/sparse-vmemmap.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
>>> index f4fa61dbbee3..78debdb89eb1 100644
>>> --- a/mm/sparse-vmemmap.c
>>> +++ b/mm/sparse-vmemmap.c
>>> @@ -528,7 +528,7 @@ void __meminit vmemmap_verify(pte_t *pte, int node,
>>>       int actual_node = early_pfn_to_nid(pfn);
>>>         if (node_distance(actual_node, node) > LOCAL_DISTANCE)
>>> -        pr_warn("[%lx-%lx] potential offnode page_structs\n",
>>> +        pr_debug("[%lx-%lx] potential offnode page_structs\n",
>>>               start, end - 1);
>>>   }
>>>   
>>
>> This will possibly hide it in environments where this might indeed
>> indicate performance issues.
>>
>> What about a pr_warn_once()?
>>
> 
> Sure.
> 
> This will works. We can certainly use a pr_warn_once().

Why not pr_warn_ratelimited() like in the previous patch ?
mawupeng June 9, 2022, 8:13 a.m. UTC | #4
在 2022/6/8 18:00, Anshuman Khandual 写道:
> 
> 
> On 6/8/22 06:56, mawupeng wrote:
>>
>>
>> 在 2022/6/7 20:25, David Hildenbrand 写道:
>>> On 07.06.22 11:38, Wupeng Ma wrote:
>>>> From: Ma Wupeng <mawupeng1@huawei.com>
>>>>
>>>> For a system only have limited mirrored memory or some numa node without
>>>> mirrored memory, the per node vmemmap page_structs prefer to allocate
>>>> memory from mirrored region, which will lead to vmemmap_verify() in
>>>> vmemmap_populate_basepages() report lots of warning message.
>>>>
>>>> This patch demote the "potential offnode page_structs" warning messages
>>>> to debug level to avoid a very long print during bootup.
>>>>
>>>> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
>>>> ---
>>>>    mm/sparse-vmemmap.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
>>>> index f4fa61dbbee3..78debdb89eb1 100644
>>>> --- a/mm/sparse-vmemmap.c
>>>> +++ b/mm/sparse-vmemmap.c
>>>> @@ -528,7 +528,7 @@ void __meminit vmemmap_verify(pte_t *pte, int node,
>>>>        int actual_node = early_pfn_to_nid(pfn);
>>>>          if (node_distance(actual_node, node) > LOCAL_DISTANCE)
>>>> -        pr_warn("[%lx-%lx] potential offnode page_structs\n",
>>>> +        pr_debug("[%lx-%lx] potential offnode page_structs\n",
>>>>                start, end - 1);
>>>>    }
>>>>    
>>>
>>> This will possibly hide it in environments where this might indeed
>>> indicate performance issues.
>>>
>>> What about a pr_warn_once()?
>>>
>>
>> Sure.
>>
>> This will works. We can certainly use a pr_warn_once().
> 
> Why not pr_warn_ratelimited() like in the previous patch ?

Function vmemmap_populate_basepages() is used to populate base pages.
System with huge memory will produce lots lots of warning message
during this populate process even with ratelimited. This may lead to slow
startup.

Thanks for reviewing.

> .
Kefeng Wang June 10, 2022, 9:35 a.m. UTC | #5
On 2022/6/9 16:13, mawupeng wrote:
>
>
> 在 2022/6/8 18:00, Anshuman Khandual 写道:
>>
>>
>> On 6/8/22 06:56, mawupeng wrote:
>>>
>>>
>>> 在 2022/6/7 20:25, David Hildenbrand 写道:
>>>> On 07.06.22 11:38, Wupeng Ma wrote:
>>>>> From: Ma Wupeng <mawupeng1@huawei.com>
>>>>>
>>>>> For a system only have limited mirrored memory or some numa node 
>>>>> without
>>>>> mirrored memory, the per node vmemmap page_structs prefer to allocate
>>>>> memory from mirrored region, which will lead to vmemmap_verify() in
>>>>> vmemmap_populate_basepages() report lots of warning message.
>>>>>
>>>>> This patch demote the "potential offnode page_structs" warning 
>>>>> messages
>>>>> to debug level to avoid a very long print during bootup.
>>>>>
>>>>> Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
>>>>> ---
>>>>>    mm/sparse-vmemmap.c | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
>>>>> index f4fa61dbbee3..78debdb89eb1 100644
>>>>> --- a/mm/sparse-vmemmap.c
>>>>> +++ b/mm/sparse-vmemmap.c
>>>>> @@ -528,7 +528,7 @@ void __meminit vmemmap_verify(pte_t *pte, int 
>>>>> node,
>>>>>        int actual_node = early_pfn_to_nid(pfn);
>>>>>          if (node_distance(actual_node, node) > LOCAL_DISTANCE)
>>>>> -        pr_warn("[%lx-%lx] potential offnode page_structs\n",
>>>>> +        pr_debug("[%lx-%lx] potential offnode page_structs\n",
>>>>>                start, end - 1);
>>>>>    }
>>>>
>>>> This will possibly hide it in environments where this might indeed
>>>> indicate performance issues.
>>>>
>>>> What about a pr_warn_once()?
>>>>
>>>
>>> Sure.
>>>
>>> This will works. We can certainly use a pr_warn_once().
>>
>> Why not pr_warn_ratelimited() like in the previous patch ?
>
> Function vmemmap_populate_basepages() is used to populate base pages.
> System with huge memory will produce lots lots of warning message
> during this populate process even with ratelimited. This may lead to slow
> startup.

I think pr_warn_once is better, the memblock_alloc fallback is not frequent,

but vmemmap_verify will verify each memory and print a lot.

>
> Thanks for reviewing.
>
>> .
> .
diff mbox series

Patch

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index f4fa61dbbee3..78debdb89eb1 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -528,7 +528,7 @@  void __meminit vmemmap_verify(pte_t *pte, int node,
 	int actual_node = early_pfn_to_nid(pfn);
 
 	if (node_distance(actual_node, node) > LOCAL_DISTANCE)
-		pr_warn("[%lx-%lx] potential offnode page_structs\n",
+		pr_debug("[%lx-%lx] potential offnode page_structs\n",
 			start, end - 1);
 }