linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memblock: If nr_new is 0 just return
@ 2016-01-09 11:30 nimisolo
  0 siblings, 0 replies; 3+ messages in thread
From: nimisolo @ 2016-01-09 11:30 UTC (permalink / raw)
  To: akpm, kuleshovmail, penberg, tony.luck, mgorman, tangchen,
	weiyang, holt
  Cc: linux-mm, linux-kernel, nimisolo

If nr_new is 0 which means there's no region would be added,
so just return to the caller.

Signed-off-by: nimisolo <nimisolo@gmail.com>
---
 mm/memblock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/memblock.c b/mm/memblock.c
index d300f13..9a30077 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -588,6 +588,9 @@ repeat:
 					       nid, flags);
 	}
 
+	if (!nr_new)
+		return 0;
+
 	/*
 	 * If this was the first round, resize array and repeat for actual
 	 * insertions; otherwise, merge and return.
-- 
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH] mm/memblock: If nr_new is 0 just return
@ 2016-01-09 11:33 nimisolo
  2016-01-12 22:40 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: nimisolo @ 2016-01-09 11:33 UTC (permalink / raw)
  To: akpm, kuleshovmail, penberg, tony.luck, mgorman, tangchen,
	weiyang
  Cc: linux-mm, linux-kernel, nimisolo

If nr_new is 0 which means there's no region would be added,
so just return to the caller.

Signed-off-by: nimisolo <nimisolo@gmail.com>
---
 mm/memblock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/memblock.c b/mm/memblock.c
index d300f13..9a30077 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -588,6 +588,9 @@ repeat:
 					       nid, flags);
 	}
 
+	if (!nr_new)
+		return 0;
+
 	/*
 	 * If this was the first round, resize array and repeat for actual
 	 * insertions; otherwise, merge and return.
-- 
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm/memblock: If nr_new is 0 just return
  2016-01-09 11:33 [PATCH] mm/memblock: If nr_new is 0 just return nimisolo
@ 2016-01-12 22:40 ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2016-01-12 22:40 UTC (permalink / raw)
  To: nimisolo
  Cc: kuleshovmail, penberg, tony.luck, mgorman, tangchen, weiyang,
	linux-mm, linux-kernel

On Sat,  9 Jan 2016 06:33:40 -0500 nimisolo <nimisolo@gmail.com> wrote:

> If nr_new is 0 which means there's no region would be added,
> so just return to the caller.
> 
> ...
>
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -588,6 +588,9 @@ repeat:
>  					       nid, flags);
>  	}
>  
> +	if (!nr_new)
> +		return 0;
> +
>  	/*
>  	 * If this was the first round, resize array and repeat for actual
>  	 * insertions; otherwise, merge and return.

hm, why?  Is there something actually wrong with the current code?

Under what circumstances does nr_new==0 actually happen?  Is it a bug
in the caller?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-01-12 22:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-09 11:33 [PATCH] mm/memblock: If nr_new is 0 just return nimisolo
2016-01-12 22:40 ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2016-01-09 11:30 nimisolo

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