[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1503251754320.26501@davide-lnx3>
Date: Wed, 25 Mar 2015 18:06:51 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Hugh Dickins <hughd@...gle.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Joern Engel <joern@...fs.org>,
Jianguo Wu <wujianguo@...wei.com>,
Eric B Munson <emunson@...mai.com>,
David Rientjes <rientjes@...gle.com>, linux-mm@...ck.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [patch][resend] MAP_HUGETLB munmap fails with size not 2MB
aligned
On Wed, 25 Mar 2015, Hugh Dickins wrote:
> When you say "tracking back to 3.2.x", I think you mean you've tried as
> far back as 3.2.x and found the same behaviour, but not tried further?
>
> From the source, it looks like this is unchanged since MAP_HUGETLB was
> introduced in 2.6.32. And is the same behaviour as you've been given
> with hugetlbfs since it arrived in 2.5.46.
Went back checking the application logs, an I had to patch the code (the
application one - to align size on munmap()) on May 2014.
But it might be we started noticing it at that time, because before the
allocation pattern was simply monotonic, so it could be it was always
there.
The bug test app is ten lines of code, to verify that.
> The patch looks to me as if it will do what you want, and I agree
> that it's displeasing that you can mmap a size, and then fail to
> munmap that same size.
>
> But I tend to think that's simply typical of the clunkiness we offer
> you with hugetlbfs and MAP_HUGETLB: that it would have been better to
> make a different choice all those years ago, but wrong to change the
> user interface now.
>
> Perhaps others will disagree. And if I'm wrong, and the behaviour
> got somehow changed in 3.2, then that's a different story and we
> should fix it back.
This is not an interface change, in the sense old clients will continue to
work.
This is simply respecting the mmap(2) POSIX specification, for a feature
which has been exposed via mmap(2).
- Davide
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists