Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-24 Thread TSUKADA Koutaro
On 2018/05/25 2:45, Mike Kravetz wrote: [...] >> THP does not guarantee to use the Huge Page, but may use the normal page. > > Note. You do not want to use THP because "THP does not guarantee". [...] >> One of the answers I have reached is to use HugeTLBfs by overcommitting >> without creating a

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-24 Thread TSUKADA Koutaro
On 2018/05/24 22:24, Michal Hocko wrote [...]> I do not see anything like that. adjust_pool_surplus is simply and > accounting thing. At least the last time I've checked. Maybe your > patchset handles that? As you said, my patch did not consider handling when manipulating the pool. And even if tha

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-24 Thread TSUKADA Koutaro
On 2018/05/24 17:20, Michal Hocko wrote: > On Thu 24-05-18 13:39:59, TSUKADA Koutaro wrote: >> On 2018/05/23 3:54, Michal Hocko wrote: > [...] >>> I am also quite confused why you keep distinguishing surplus hugetlb >>> pages from regular preallocated on

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-23 Thread TSUKADA Koutaro
On 2018/05/23 3:54, Michal Hocko wrote: > On Tue 22-05-18 22:04:23, TSUKADA Koutaro wrote: >> On 2018/05/22 3:07, Mike Kravetz wrote: >>> On 05/17/2018 09:27 PM, TSUKADA Koutaro wrote: >>>> Thanks to Mike Kravetz for comment on the previous version patch. >>>

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-23 Thread TSUKADA Koutaro
On 2018/05/22 22:51, Michal Hocko wrote: > On Fri 18-05-18 13:27:27, TSUKADA Koutaro wrote: >> The purpose of this patch-set is to make it possible to control whether or >> not to charge surplus hugetlb pages obtained by overcommitting to memory >> cgroup. In the future, I am

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-22 Thread TSUKADA Koutaro
On 2018/05/22 3:07, Mike Kravetz wrote: > On 05/17/2018 09:27 PM, TSUKADA Koutaro wrote: >> Thanks to Mike Kravetz for comment on the previous version patch. >> >> The purpose of this patch-set is to make it possible to control whether or >> not to charge surplu

Re: [PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-22 Thread TSUKADA Koutaro
Hi Punit, On 2018/05/21 23:52, Punit Agrawal wrote: > Hi Tsukada, > > I was staring at memcg code to better understand your changes and had > the below thought. > > TSUKADA Koutaro writes: > > [...] > >> In this patch-set, introduce the charge_surplus_huge_p

Re: [PATCH v2 3/7] memcg: use compound_order rather than hpage_nr_pages

2018-05-20 Thread TSUKADA Koutaro
On 2018/05/19 2:51, Punit Agrawal wrote: Punit Agrawal writes: Tsukada-san, I am not familiar with memcg so can't comment about whether the patchset is the right way to solve the problem outlined in the cover letter but had a couple of comments about this patch. TSUKADA Koutaro w

[PATCH v2 2/7] hugetlb: support migrate charging for surplus hugepages

2018-05-17 Thread TSUKADA Koutaro
Surplus hugepages allocated for migration also charge to memory cgroup. Signed-off-by: TSUKADA Koutaro --- hugetlb.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 679c151f..2e7b543 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1687,6 +1687,8

[PATCH v2 7/7] memcg: supports movement of surplus hugepages statistics

2018-05-17 Thread TSUKADA Koutaro
When the task that charged surplus hugepages moves memory cgroup, it updates the statistical information correctly. Signed-off-by: TSUKADA Koutaro --- memcontrol.c | 99 +++ 1 file changed, 99 insertions(+) diff --git a/mm/memcontrol.c

[PATCH v2 6/7] Documentation, hugetlb: describe about charge_surplus_hugepages,

2018-05-17 Thread TSUKADA Koutaro
Add a description about charge_surplus_hugepages. Signed-off-by: TSUKADA Koutaro --- hugetlbpage.txt |6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index faf077d..af8d112 100644 --- a/Documentation/vm

[PATCH v2 5/7] hugetlb: add charge_surplus_hugepages attribute

2018-05-17 Thread TSUKADA Koutaro
Add an entry for charge_surplus_hugepages to sysfs. Signed-off-by: TSUKADA Koutaro --- hugetlb.c | 25 + 1 file changed, 25 insertions(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9a9549c..2f9bdbc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2662,6 +2662,30

[PATCH v2 1/7] hugetlb: introduce charge_surplus_huge_pages to struct hstate

2018-05-17 Thread TSUKADA Koutaro
for surplus hugepage charging. Mark when surplus hugepage is obtained from normal pool, and charge to memory cgroup at alloc_huge_page. Once the mapping of the page is decided, commit the charge. surplus hugepages will uncharge or cancel at free_huge_page. Signed-off-by: TSUKADA Koutaro

[PATCH v2 0/7] mm: pages for hugetlb's overcommit may be able to charge to memcg

2018-05-17 Thread TSUKADA Koutaro
t, so I just done a simple test. Thanks, Tsukada TSUKADA Koutaro (7): hugetlb: introduce charge_surplus_huge_pages to struct hstate hugetlb: supports migrate charging for surplus hugepages memcg: use compound_order rather than hpage_nr_pages mm, sysctl: make charging surplus huge

[PATCH v2 4/7] mm, sysctl: make charging surplus hugepages controllable

2018-05-17 Thread TSUKADA Koutaro
Make the default hugetlb surplus hugepage controlable by /proc/sys/vm/charge_surplus_hugepages. Signed-off-by: TSUKADA Koutaro --- include/linux/hugetlb.h |2 ++ kernel/sysctl.c |7 +++ mm/hugetlb.c| 21 + 3 files changed, 30 insertions

[PATCH v2 3/7] memcg: use compound_order rather than hpage_nr_pages

2018-05-17 Thread TSUKADA Koutaro
The current memcg implementation assumes that the compound page is THP. In order to be able to charge surplus hugepage, we use compound_order. Signed-off-by: TSUKADA Koutaro --- memcontrol.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm