Skip to contentSkip to conversation

mm: Fix a typo in __next_mem_pfn_range() comments.

PATCH cc 1 participant 1 message Nov 8, 2018 6 messages not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20181107135421.GA5638@rapoport-lnx

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20181107143703.GB5638@rapoport-lnx

A message that is not in the archive (sent off-list or not yet received): [email protected]

cc

author
#6 lore raw

Thanks for all your replies,i am a newbie here.

Quoted 46 lines · Michal Hocko <[email protected]> 于2018年11月7日周三 下午11:03写道:
Quoted 7 lines · Mike Rapoport
Quoted 6 lines · Michal Hocko
Quoted 5 lines · Mike Rapoport
Quoted 4 lines · Michal Hocko
Quoted 1 line · Chen Chang

mm: Fix a typo in __next_mem_pfn_range() comments.

those two names are just too similar. And I wouldn't be surprised

if

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

there was a considerable overlap in functionality which just asks

for

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

a unification. In a separate patch of course.

There is an overlap, but I'm not sure if the unification is straight forward. The for_each_mem_pfn_range() is really simple iterator,

while

Quoted 14 lines
Quoted 4 lines
Quoted 1 line

for_each_mem_range() has additional logic based on memblock flags.

Is there any reason we cannot emulate the former by later by type_b = NULL and flags=0?

Mostly. There's a hotplug related check:

      /* skip hotpluggable memory regions if needed */
      if (movable_node_is_enabled() && memblock_is_hotpluggable(m))
              continue;

in __next_mem_range() that is not related to flags and type_b and I don't understand hotplug enough to tell.

Quoted 8 lines

Maybe this check can become

      /* skip hotpluggable memory regions if needed */
        if ((flags & MEMBLOCK_HOTPLUG) && movable_node_is_enabled() &&
           memblock_is_hotpluggable(m))
                continue;

and then using flags=0 and type_b=NULL would be possible.

OK, let's discuss this in a separate thread. A simlification in this area is always welcome ;)

--
Michal Hocko
SUSE Labs