linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric B Munson <emunson@akamai.com>
To: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Davide Libenzi <davidel@xmailserver.org>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Joern Engel <joern@logfs.org>, Jianguo Wu <wujianguo@huawei.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [patch 1/2] mm, doc: cleanup and clarify munmap behavior for hugetlb memory
Date: Mon, 30 Mar 2015 10:23:36 -0400	[thread overview]
Message-ID: <20150330142336.GB17678@akamai.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1503291801400.1052@eggly.anvils>

[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]

On Sun, 29 Mar 2015, Hugh Dickins wrote:

> On Thu, 26 Mar 2015, David Rientjes wrote:
> 
> > munmap(2) of hugetlb memory requires a length that is hugepage aligned,
> > otherwise it may fail.  Add this to the documentation.
> 
> Thanks for taking this on, David.  But although munmap(2) is the one
> Davide called out, it goes beyond that, doesn't it?  To mprotect and
> madvise and ...
> 
> I don't want to work out the list myself: is_vm_hugetlb_page() is
> special-cased all over, and different syscalls react differently.
> 
> Which is another reason why, like you, I much prefer not to interfere
> with the long established behavior: it would be very easy to introduce
> bugs and worse inconsistencies.
> 
> And mprotect(2) is a good example of why we should not mess around
> with the long established API here: changing an mprotect from failing
> on a particular size to acting on a larger size is not a safe change.
> 
> Eric, I apologize for bringing you in to the discussion, and then
> ignoring your input.  I understand that you would like MAP_HUGETLB
> to behave more understandably.  We can all agree that the existing
> behavior is unsatisfying.  But it's many years too late now to 
> change it around - and I suspect that a full exercise to do so would
> actually discover some good reasons why the original choices were made.

No worries, my main concern was avoiding the confusion that led me down
the rabbit hole of compaction and mlock.  As long as the documentation,
man pages, and the code all agree I am satisfied.  I would have
preferred to make the code match the docs, but I understand that
changing the code now introduces a risk of breaking userspace.

It is charitable of you to assume that there were good reasons for the
original decision.  But as the author of the code in question, I suspect
the omission was one of my own inexperience.

Eric

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-03-30 14:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 23:23 [patch 1/2] mm, doc: cleanup and clarify munmap behavior for hugetlb memory David Rientjes
2015-03-26 23:23 ` [patch 2/2] mm, selftests: test return value of munmap for MAP_HUGETLB memory David Rientjes
2015-03-26 23:52   ` Michael Ellerman
2015-03-27 13:58 ` [patch 1/2] mm, doc: cleanup and clarify munmap behavior for hugetlb memory Eric B Munson
2015-03-28  1:37   ` David Rientjes
2015-03-30  1:35 ` Hugh Dickins
2015-03-30 14:23   ` Eric B Munson [this message]
2015-03-30 20:23     ` Hugh Dickins
2015-04-02 22:40   ` David Rientjes
2015-04-02 22:50     ` [patch -mm] mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix David Rientjes
2015-04-03  1:05       ` Hugh Dickins
2015-04-04  9:34       ` Jonathan Corbet
2015-04-09 19:46         ` David Rientjes
2015-04-11 13:26           ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150330142336.GB17678@akamai.com \
    --to=emunson@akamai.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=davidel@xmailserver.org \
    --cc=hughd@google.com \
    --cc=joern@logfs.org \
    --cc=lcapitulino@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=wujianguo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).