lkml.org 
[lkml]   [2022]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] memblock: remove repeat round
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?


--
Sincerely yours,
Mike.

\
 
 \ /
  Last update: 2022-10-26 08:05    [W:0.079 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site