From: Mike Kravetz <mike.kravetz@oracle.com>
To: Mina Almasry <almasrymina@google.com>
Cc: shuah <shuah@kernel.org>, "David Rientjes" <rientjes@google.com>,
"Shakeel Butt" <shakeelb@google.com>,
"Greg Thelen" <gthelen@google.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"open list" <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
cgroups@vger.kernel.org,
"Aneesh Kumar" <aneesh.kumar@linux.vnet.ibm.com>,
"Michal Koutný" <mkoutny@suse.com>,
"Hillf Danton" <hdanton@sina.com>
Subject: Re: [PATCH v9 1/8] hugetlb_cgroup: Add hugetlb_cgroup reservation counter
Date: Mon, 13 Jan 2020 14:05:58 -0800 [thread overview]
Message-ID: <a78595a8-448c-14bb-a54b-9be685f36388@oracle.com> (raw)
In-Reply-To: <CAHS8izNs24KOaRuQkVUuZZUh42rvkyBXJEJYrHNf9bLFnZEXCg@mail.gmail.com>
On 1/13/20 1:03 PM, Mina Almasry wrote:
> On Mon, Jan 13, 2020 at 10:44 AM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>>
>> On 12/17/19 3:16 PM, Mina Almasry wrote:
>>> - While usage_in_bytes tracks all *faulted* hugetlb memory,
>>> reservation_usage_in_bytes tracks all *reserved* hugetlb memory and
>>> hugetlb memory faulted in without a prior reservation.
>>
>> To me, this implies that 'faults without reservations' could cause
>> reservation usage to exceed reservation limit? Or, does the faulting
>> process get a SIGBUS because of the reservation limit even though it
>> is not using reservations?
>>
>> We shall see in subsequent patches.
>>
>
> The design we went with based on previous discussions is as follows:
> hugetlb pages faulted without a prior reservation get accounted at
> fault time, rather than reservation time, and if the fault causes the
> counter to cross the limit, the charge fails, hence the fault fails,
> hence the process gets sigbus'd.
Ok, sorry I did not recall the design discussion.
> This means that one counter I'm adding here can cover both use cases:
> if the userspace uses MAP_NORESERVE, then their memory is accounted at
> fault time and they may get sigbus'd.
Let's make sure this is clearly documented. Someone could be surprised
if their application not using reserves gets a SIGBUS because there is a
reserve limit.
--
Mike Kravetz
next prev parent reply other threads:[~2020-01-13 22:08 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 23:16 [PATCH v9 1/8] hugetlb_cgroup: Add hugetlb_cgroup reservation counter Mina Almasry
2019-12-17 23:16 ` [PATCH v9 2/8] hugetlb_cgroup: add interface for charge/uncharge hugetlb reservations Mina Almasry
2020-01-13 22:14 ` Mike Kravetz
2020-01-14 0:45 ` David Rientjes
2020-01-14 22:55 ` Mina Almasry
2019-12-17 23:16 ` [PATCH v9 3/8] hugetlb_cgroup: add reservation accounting for private mappings Mina Almasry
2020-01-14 0:55 ` Mike Kravetz
2020-01-14 22:52 ` Mina Almasry
2020-01-17 22:09 ` Mike Kravetz
2020-01-22 21:40 ` Mina Almasry
2019-12-17 23:16 ` [PATCH v9 4/8] hugetlb: disable region_add file_region coalescing Mina Almasry
2020-01-21 17:38 ` Mike Kravetz
2020-01-21 17:40 ` Mike Kravetz
2019-12-17 23:16 ` [PATCH v9 5/8] hugetlb_cgroup: add accounting for shared mappings Mina Almasry
2019-12-17 23:16 ` [PATCH v9 6/8] hugetlb_cgroup: support noreserve mappings Mina Almasry
2020-01-14 0:48 ` David Rientjes
2019-12-17 23:16 ` [PATCH v9 7/8] hugetlb_cgroup: Add hugetlb_cgroup reservation tests Mina Almasry
2019-12-17 23:16 ` [PATCH v9 8/8] hugetlb_cgroup: Add hugetlb_cgroup reservation docs Mina Almasry
2020-01-14 0:54 ` David Rientjes
2019-12-19 1:12 ` [PATCH v9 1/8] hugetlb_cgroup: Add hugetlb_cgroup reservation counter Andrew Morton
2019-12-19 1:37 ` Mike Kravetz
2019-12-19 1:59 ` Mina Almasry
2020-01-13 18:43 ` Mike Kravetz
2020-01-13 21:03 ` Mina Almasry
2020-01-13 22:05 ` Mike Kravetz [this message]
2020-01-13 22:21 ` Mina Almasry
2020-01-14 0:45 ` David Rientjes
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=a78595a8-448c-14bb-a54b-9be685f36388@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=almasrymina@google.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=cgroups@vger.kernel.org \
--cc=gthelen@google.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mkoutny@suse.com \
--cc=rientjes@google.com \
--cc=shakeelb@google.com \
--cc=shuah@kernel.org \
/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).