Re: [PATCH] memory-hotplug: Fix bad area access on dissolve_free_huge_pages()

From: Michal Hocko
Date: Wed Sep 21 2016 - 12:54:28 EST

On Wed 21-09-16 09:32:10, Dave Hansen wrote:
> On 09/21/2016 09:27 AM, Michal Hocko wrote:
> > That was not my point. I wasn't very clear probably. Offlining can fail
> > which shouldn't be really surprising. There might be a kernel allocation
> > in the particular block which cannot be migrated so failures are to be
> > expected. I just do not see how offlining in the middle of a gigantic
> > page is any different from having any other unmovable allocation in a
> > block. That being said, why don't we simply refuse to offline a block
> > which is in the middle of a gigantic page.
> Don't we want to minimize the things that can cause an offline to fail?
> The code to fix it here doesn't seem too bad.

I am not really sure. So say somebody wants to offline few blocks (does
offlining anything but whole nodes make any sense btw.?) and that
happens to be in the middle of a gigantic huge page which is not really
that easy to allocate, do we want to free it in order to do the offline?
To me it sounds like keeping the gigantic page should be preffered but
I have to admit I do not really understand the per-block offlining

Michal Hocko