* [PATCH] mm/memblock:Do not retry a range that has already been checked
@ 2020-05-24 14:16 daeroro
2020-05-24 17:49 ` Mike Rapoport
0 siblings, 1 reply; 2+ messages in thread
From: daeroro @ 2020-05-24 14:16 UTC (permalink / raw)
To: Mike Rapoport; +Cc: linux-mm, linux-kernel
The range that has already been checked
don't have to be checked in a second attempt.
Signed-off-by: daeroro <skseofh@naver.com>
---
mm/memblock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 39aceafc57f6..6f72fae415ee 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1489,7 +1489,7 @@ static void * __init memblock_alloc_internal(
/* retry allocation without lower limit */
if (!alloc && min_addr)
- alloc = memblock_alloc_range_nid(size, align, 0, max_addr, nid,
+ alloc = memblock_alloc_range_nid(size, align, 0, min_addr, nid,
exact_nid);
if (!alloc)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/memblock:Do not retry a range that has already been checked
2020-05-24 14:16 [PATCH] mm/memblock:Do not retry a range that has already been checked daeroro
@ 2020-05-24 17:49 ` Mike Rapoport
0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2020-05-24 17:49 UTC (permalink / raw)
To: daeroro; +Cc: linux-mm, linux-kernel
On Sun, May 24, 2020 at 11:16:40PM +0900, daeroro wrote:
> The range that has already been checked
> don't have to be checked in a second attempt.
The first attempts tries to find free memory in the interval [min_addr,
max_addr) and the second attempt does not care about min_addr and looks
for free memory in the interval [0, max_addr).
Is there a problem you see with this algorthim?
> Signed-off-by: daeroro <skseofh@naver.com>
> ---
> mm/memblock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 39aceafc57f6..6f72fae415ee 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -1489,7 +1489,7 @@ static void * __init memblock_alloc_internal(
>
> /* retry allocation without lower limit */
> if (!alloc && min_addr)
> - alloc = memblock_alloc_range_nid(size, align, 0, max_addr, nid,
> + alloc = memblock_alloc_range_nid(size, align, 0, min_addr, nid,
> exact_nid);
>
> if (!alloc)
> --
> 2.17.1
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-24 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24 14:16 [PATCH] mm/memblock:Do not retry a range that has already been checked daeroro
2020-05-24 17:49 ` Mike Rapoport
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).