On Mon 19-11-18 14:15:05, Wei Yang wrote: > On Mon, Nov 19, 2018 at 11:07:41AM +0100, osalvador wrote: > > > >> Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> > > > >Good catch. > > > >One thing I was wondering is that if we also should re-adjust it when a > >zone gets emptied during offlining memory. > >I checked, and whenever we work wirh pgdat->nr_zones we seem to check > >if the zone is populated in order to work with it. > >But still, I wonder if we should re-adjust it. > > Well, thanks all for comments. I am glad you like it. > > Actually, I have another proposal or I notice another potential issue. > > In case user online pages in parallel, we may face a contention and get > a wrong nr_zones. No, this should be protected by the global mem hotplug lock. Anyway a dedicated lock would be much better. I would move it under pgdat_resize_lock. -- Michal Hocko SUSE Labs