lkml.org 
[lkml]   [2023]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 1/2] mm/memory_hotplug: split memmap_on_memory requests across memblocks
Date
On Thu, 2023-10-12 at 10:40 +0200, David Hildenbrand wrote:
> On 12.10.23 07:53, Verma, Vishal L wrote:
> > On Mon, 2023-10-09 at 17:04 +0200, David Hildenbrand wrote:
> > > On 07.10.23 10:55, Huang, Ying wrote:
> > > > Vishal Verma <vishal.l.verma@intel.com> writes:
>
<..>
> > +
> > +       for (cur_start = start; cur_start < start + size;
> > +            cur_start += memblock_size) {
> > +               if (walk_memory_blocks(cur_start, memblock_size, &mem,
> > +                                      test_has_altmap_cb))
> > +                       num_altmaps++;
> > +               else
> > +                       num_no_altmaps++;
> > +       }
>
> You should do that without the outer loop, by doing the counting in the
> callback function instead.      
>
>
I made a new callback, since the existing callback that returns the
memory_block breaks the walk the first time an altmap was encountered.

Agreed on all the other comments - it looks much cleaner now!

Sending v6 shortly with all of this.
\
 
 \ /
  Last update: 2023-10-16 20:19    [W:0.092 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site