Re: [PATCH] mm, show_mem: drop pgdat_resize_lock in show_mem()

Michal Hocko
2018-11-29T15:49:26Z

On Thu 29-11-18 15:04:49, Wei Yang wrote:
> On Thu, Nov 29, 2018 at 09:17:03AM +0100, Michal Hocko wrote:
> >On Thu 29-11-18 05:08:15, Wei Yang wrote:
> >> Function show_mem() is used to print system memory status when user
> >> requires or fail to allocate memory. Generally, this is a best effort
> >> information and not willing to affect core mm subsystem.
> >
> >I would drop the part after and
> >
> >> The data protected by pgdat_resize_lock is mostly correct except there is:
> >>
> >> * page struct defer init
> >> * memory hotplug
> >
> >This is more confusing than helpful. I would just drop it.
> >
> >The changelog doesn't explain what is done and why. The second one is
> >much more important. I would say this
> >
> >"
> >Function show_mem() is used to print system memory status when user
> >requires or fail to allocate memory. Generally, this is a best effort
> >information so any races with memory hotplug (or very theoretically an
> >early initialization) should be toleratable and the worst that could
> >happen is to print an imprecise node state.
> >
> >Drop the resize lock because this is the only place which might hold the
>
> As I mentioned in https://patchwork.kernel.org/patch/10689759/, there is
> one place used in __remove_zone(). I don't get your suggestion of this
> place. And is __remove_zone() could be called in IRQ context?

It is only called from __remove_pages and that one calls cond_resched so
obviosly not.

--
Michal Hocko
SUSE Labs