linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
@ 2021-03-25 11:31 Wang Wensheng
  2021-03-25 12:45 ` David Hildenbrand
  2021-03-25 13:21 ` Oscar Salvador
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Wensheng @ 2021-03-25 11:31 UTC (permalink / raw)
  To: akpm, osalvador, pasha.tatashin, linux-mm, linux-kernel; +Cc: rui.xiang

sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
a WARN issue would be through the next time sparse_buffer_init() runs.

Add the missing sparse_buffer_fini() in error branch.

Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
 mm/sparse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/sparse.c b/mm/sparse.c
index 7bd23f9..33406ea 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
 			pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
 			       __func__, nid);
 			pnum_begin = pnum;
+			sparse_buffer_fini();
 			goto failed;
 		}
 		check_usemap_section_nr(nid, usage);
-- 
2.9.4


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

* Re: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
  2021-03-25 11:31 [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch Wang Wensheng
@ 2021-03-25 12:45 ` David Hildenbrand
  2021-03-25 13:21 ` Oscar Salvador
  1 sibling, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2021-03-25 12:45 UTC (permalink / raw)
  To: Wang Wensheng, akpm, osalvador, pasha.tatashin, linux-mm, linux-kernel
  Cc: rui.xiang

On 25.03.21 12:31, Wang Wensheng wrote:
> sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
> a WARN issue would be through the next time sparse_buffer_init() runs.
> 
> Add the missing sparse_buffer_fini() in error branch.
> 
> Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> ---
>   mm/sparse.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 7bd23f9..33406ea 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
>   			pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
>   			       __func__, nid);
>   			pnum_begin = pnum;
> +			sparse_buffer_fini();
>   			goto failed;
>   		}
>   		check_usemap_section_nr(nid, usage);
> 

Did you actually manage to reproduce this? I would have thought that 
__populate_section_memmap() barely fails during boot ...


Anyhow, looks like the right think to do to me

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


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

* Re: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
  2021-03-25 11:31 [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch Wang Wensheng
  2021-03-25 12:45 ` David Hildenbrand
@ 2021-03-25 13:21 ` Oscar Salvador
  1 sibling, 0 replies; 5+ messages in thread
From: Oscar Salvador @ 2021-03-25 13:21 UTC (permalink / raw)
  To: Wang Wensheng; +Cc: akpm, pasha.tatashin, linux-mm, linux-kernel, rui.xiang

On Thu, Mar 25, 2021 at 11:31:55AM +0000, Wang Wensheng wrote:
> sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
> a WARN issue would be through the next time sparse_buffer_init() runs.
> 
> Add the missing sparse_buffer_fini() in error branch.
> 
> Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>


-- 
Oscar Salvador
SUSE L3

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

* Re: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
  2021-03-26  2:23 Wang Wensheng
@ 2021-03-26  9:11 ` David Hildenbrand
  0 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2021-03-26  9:11 UTC (permalink / raw)
  To: Wang Wensheng, akpm, pasha.tatashin, osalvador, linux-mm, linux-kernel
  Cc: rui.xiang

On 26.03.21 03:23, Wang Wensheng wrote:
> sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
> a WARN issue would be through the next time sparse_buffer_init() runs.
> 
> Add the missing sparse_buffer_fini() in error branch.
> 
> Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> ---
>   mm/sparse.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 7bd23f9..33406ea 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
>   			pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
>   			       __func__, nid);
>   			pnum_begin = pnum;
> +			sparse_buffer_fini();
>   			goto failed;
>   		}
>   		check_usemap_section_nr(nid, usage);
> 

I am confused, why the resend, and why without RBs?

https://lkml.kernel.org/r/20210325113155.118574-1-wangwensheng4@huawei.com

-- 
Thanks,

David / dhildenb


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

* [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch
@ 2021-03-26  2:23 Wang Wensheng
  2021-03-26  9:11 ` David Hildenbrand
  0 siblings, 1 reply; 5+ messages in thread
From: Wang Wensheng @ 2021-03-26  2:23 UTC (permalink / raw)
  To: akpm, pasha.tatashin, osalvador, linux-mm, linux-kernel; +Cc: rui.xiang

sparse_buffer_init() and sparse_buffer_fini() should appear in pair, or
a WARN issue would be through the next time sparse_buffer_init() runs.

Add the missing sparse_buffer_fini() in error branch.

Fixes: 85c77f791390 ("mm/sparse: add new sparse_init_nid() and sparse_init()")
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
 mm/sparse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/sparse.c b/mm/sparse.c
index 7bd23f9..33406ea 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -547,6 +547,7 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
 			pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.",
 			       __func__, nid);
 			pnum_begin = pnum;
+			sparse_buffer_fini();
 			goto failed;
 		}
 		check_usemap_section_nr(nid, usage);
-- 
2.9.4


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

end of thread, other threads:[~2021-03-26  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 11:31 [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch Wang Wensheng
2021-03-25 12:45 ` David Hildenbrand
2021-03-25 13:21 ` Oscar Salvador
2021-03-26  2:23 Wang Wensheng
2021-03-26  9:11 ` David Hildenbrand

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).