linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Yajun Deng" <yajun.deng@linux.dev>
To: "Mike Rapoport" <rppt@kernel.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memblock: remove repeat round
Date: Wed, 26 Oct 2022 06:18:03 +0000	[thread overview]
Message-ID: <b4af84bdc4b9c757c9fea2e63dd98a61@linux.dev> (raw)
In-Reply-To: <Y1jN/KeU6dgJWQIL@kernel.org>

October 26, 2022 2:04 PM, "Mike Rapoport" <rppt@kernel.org> wrote:

> On Tue, Oct 25, 2022 at 03:24:58AM +0000, Yajun Deng wrote:
> 
>> October 25, 2022 12:15 AM, "Mike Rapoport" <rppt@kernel.org> wrote:
>> 
>> @@ -598,22 +597,6 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
>> return 0;
>> }
>> 
>> - /*
>> - * The worst case is when new range overlaps all existing regions,
>> - * then we'll need type->cnt + 1 empty regions in @type. So if
>> - * type->cnt * 2 + 1 is less than type->max, we know
>> - * that there is enough empty regions in @type, and we can insert
>> - * regions directly.
>> - */
>> - if (type->cnt * 2 + 1 < type->max)
>> - insert = true;
>> -
>> -repeat:
>> - /*
>> - * The following is executed twice. Once with %false @insert and
>> - * then with %true. The first counts the number of regions needed
>> - * to accommodate the new area. The second actually inserts them.
>> - */
>> base = obase;
>> nr_new = 0;
>> 
>> I believe nr_new variable is no longer needed, is it?
>> 
>> No, nr_new is needed before memblock_merge_regions() for return.
> 
> Why?
> 
Sorry, nr_new was removed, and added ocnt variable for the original of type->cnt.

I already sent another patch with '[PATCH v2] memblock: don't run loop in 
memblock_add_range() twice' subject, you can see that.

> --
> Sincerely yours,
> Mike.


      parent reply	other threads:[~2022-10-26  6:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 12:03 [PATCH] memblock: remove repeat round Yajun Deng
2022-10-24 16:15 ` Mike Rapoport
2022-10-25  3:24 ` Yajun Deng
2022-10-26  6:04   ` Mike Rapoport
2022-10-26  6:18   ` Yajun Deng [this message]

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=b4af84bdc4b9c757c9fea2e63dd98a61@linux.dev \
    --to=yajun.deng@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    /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 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).