From: Hillf Danton <hdanton@sina.com>
To: Mina Almasry <almasrymina@google.com>
Cc: mike.kravetz@oracle.com, shuah@kernel.org, rientjes@google.com,
shakeelb@google.com, gthelen@google.com,
akpm@linux-foundation.org, khalid.aziz@oracle.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org,
aneesh.kumar@linux.vnet.ibm.com, mkoutny@suse.com,
Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH v4 3/9] hugetlb_cgroup: add reservation accounting for private mappings
Date: Wed, 11 Sep 2019 16:35:31 +0800 [thread overview]
Message-ID: <20190911083531.12272-1-hdanton@sina.com> (raw)
In-Reply-To: <20190910233146.206080-1-almasrymina@google.com>
On Tue, 10 Sep 2019 16:31:40 -0700 From: Mina Almasry <almasrymina@google.com>
>
> @@ -3203,6 +3225,8 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma)
> gbl_reserve = hugepage_subpool_put_pages(spool, reserve);
> hugetlb_acct_memory(h, -gbl_reserve);
> }
Double thanks for cleaning up the gbl typo.
> +
> + kref_put(&resv->refs, resv_map_release);
> }
>
>
> @@ -4569,11 +4594,29 @@ int hugetlb_reserve_pages(struct inode *inode,
> chg = region_chg(resv_map, from, to);
>
> } else {
> + /* Private mapping. */
> + chg = to - from;
> +
> + if (hugetlb_cgroup_charge_cgroup(
> + hstate_index(h),
> + chg * pages_per_huge_page(h),
> + &h_cg, true)) {
> + return -ENOMEM;
> + }
> +
> resv_map = resv_map_alloc();
> if (!resv_map)
> return -ENOMEM;
Put charge after allocating resv_map.
Other than that
Acked-by: Hillf Danton <hdanton@sina.com>
prev parent reply other threads:[~2019-09-11 8:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 23:31 [PATCH v4 0/9] hugetlb_cgroup: Add hugetlb_cgroup reservation limits Mina Almasry
2019-09-10 23:31 ` [PATCH v4 1/9] hugetlb_cgroup: Add hugetlb_cgroup reservation counter Mina Almasry
2019-09-16 23:43 ` shuah
2019-09-10 23:31 ` [PATCH v4 2/9] hugetlb_cgroup: add interface for charge/uncharge hugetlb reservations Mina Almasry
2019-09-17 1:29 ` shuah
2019-09-10 23:31 ` [PATCH v4 3/9] hugetlb_cgroup: add reservation accounting for private mappings Mina Almasry
2019-09-10 23:31 ` [PATCH v4 4/9] hugetlb: region_chg provides only cache entry Mina Almasry
2019-09-16 22:17 ` Mike Kravetz
2019-09-10 23:31 ` [PATCH v4 5/9] hugetlb: remove duplicated code Mina Almasry
2019-09-16 22:25 ` Mike Kravetz
2019-09-10 23:31 ` [PATCH v4 6/9] hugetlb: disable region_add file_region coalescing Mina Almasry
2019-09-16 23:57 ` Mike Kravetz
2019-09-17 0:16 ` Mina Almasry
2019-09-10 23:31 ` [PATCH v4 7/9] hugetlb_cgroup: add accounting for shared mappings Mina Almasry
2019-09-10 23:31 ` [PATCH v4 8/9] hugetlb_cgroup: Add hugetlb_cgroup reservation tests Mina Almasry
2019-09-17 1:52 ` shuah
2019-09-19 1:53 ` Mina Almasry
2019-09-10 23:31 ` [PATCH v4 9/9] hugetlb_cgroup: Add hugetlb_cgroup reservation docs Mina Almasry
2019-09-17 1:58 ` shuah
2019-09-11 8:35 ` Hillf Danton [this message]
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=20190911083531.12272-1-hdanton@sina.com \
--to=hdanton@sina.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=khalid.aziz@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--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).