All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: daeroro <skseofh@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memblock:Do not retry a range that has already been checked
Date: Sun, 24 May 2020 20:49:22 +0300	[thread overview]
Message-ID: <20200524174922.GB1515425@linux.ibm.com> (raw)
In-Reply-To: <20200524141640.GA10017@roro-Lenovo-Y520-15IKBN>

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.


  reply	other threads:[~2020-05-24 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
     [not found]   ` <CAATEi5n-W-ZiurGvaF_jNUnxNE1Y_XbdSVy7sN_BH4JPURQL1Q@mail.gmail.com>
     [not found]     ` <20200525103458.GA13212@linux.ibm.com>
     [not found]       ` <20200525154838.GA14725@roro-Lenovo-Y520-15IKBN>
2020-05-25 16:05         ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200524174922.GB1515425@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=skseofh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.