Thanks for all your replies,i am a newbie here.
Michal Hocko <mhocko@xxxxxxxx> 于2018年11月7日周三 下午11:03写道:
On Wed 07-11-18 16:37:05, Mike Rapoport wrote:
> On Wed, Nov 07, 2018 at 03:13:06PM +0100, Michal Hocko wrote:
> > On Wed 07-11-18 15:54:22, Mike Rapoport wrote:
> > > On Wed, Nov 07, 2018 at 11:25:49AM +0100, Michal Hocko wrote:
> > > > On Wed 07-11-18 18:02:47, Chen Chang wrote:
> > > > > mm: Fix a typo in __next_mem_pfn_range() comments.
> > > >
> > > > those two names are just too similar. And I wouldn't be surprised if
> > > > there was a considerable overlap in functionality which just asks for
> > > > 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
> > > 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.
>
> 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