[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b4af84bdc4b9c757c9fea2e63dd98a61@linux.dev>
Date: Wed, 26 Oct 2022 06:18:03 +0000
From: "Yajun Deng" <yajun.deng@...ux.dev>
To: "Mike Rapoport" <rppt@...nel.org>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] memblock: remove repeat round
October 26, 2022 2:04 PM, "Mike Rapoport" <rppt@...nel.org> wrote:
> On Tue, Oct 25, 2022 at 03:24:58AM +0000, Yajun Deng wrote:
>
>> October 25, 2022 12:15 AM, "Mike Rapoport" <rppt@...nel.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.
Powered by blists - more mailing lists