[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191031112609.GG13102@dhcp22.suse.cz>
Date: Thu, 31 Oct 2019 12:26:09 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Li Xinhai <lixinhai.lxh@...il.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>, Babka <vbabka@...e.cz>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
API <linux-api@...r.kernel.org>, Dickins <hughd@...gle.com>,
linux-man@...r.kernel.org
Subject: Re: [PATCH v2] mm: Fix checking unmapped holes for mbind
On Wed 30-10-19 21:08:36, Andrew Morton wrote:
> (cc linux-man@...r.kernel.org)
>
> On Tue, 29 Oct 2019 17:56:06 +0800 "Li Xinhai" <lixinhai.lxh@...il.com> wrote:
>
> > queue_pages_range() will check for unmapped holes besides queue pages for
> > migration. The rules for checking unmapped holes are:
> > 1 Unmapped holes at any part of the specified range should be reported as
> > EFAULT if mbind() for none MPOL_DEFAULT cases;
> > 2 Unmapped holes at any part of the specified range should be ignored if
> > mbind() for MPOL_DEFAULT case;
> > Note that the second rule is the current implementation, but it seems
> > conflicts the Linux API definition.
>
> Can you quote the part of the API definition which you're looking at?
>
> My mbind(2) manpage says
>
> ERRORS
> EFAULT Part or all of the memory range specified by nodemask and maxn-
> ode points outside your accessible address space. Or, there was
> an unmapped hole in the specified memory range specified by addr
> and len.
>
> (I assume the first sentence meant to say "specified by addr and len")
My understanding is that this really refers to area pointed to by nodemask.
Btw. why there is any special casing around the unmapped holes with the
address space range? This looks like an antipattern to other address
space operations to me. E.g. munmap simply unmaps all existing vmas in
the given range, mprotect, madvise etc. behave the same.
So my question is, do we want to remove that weird restriction and
simply act on all existing VMAs in the range? The only situation this
could regress would be if somebody used mbind to probe for existing VMAs
and that sounds a more than sensible to me. Or am I missing anything?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists