From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id C7D136B056C for ; Fri, 18 May 2018 00:32:49 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id l85-v6so3988386pfb.18 for ; Thu, 17 May 2018 21:32:49 -0700 (PDT) Received: from ns.ascade.co.jp (ext-host0001.ascade.co.jp. [218.224.228.194]) by mx.google.com with ESMTP id g34-v6si6581258pld.411.2018.05.17.21.32.48 for ; Thu, 17 May 2018 21:32:48 -0700 (PDT) Subject: [PATCH v2 2/7] hugetlb: support migrate charging for surplus hugepages References: From: TSUKADA Koutaro Message-ID: <48877585-85de-ad4b-6b35-8e6dd24a43c0@ascade.co.jp> Date: Fri, 18 May 2018 13:32:41 +0900 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner , Michal Hocko , Vladimir Davydov , Jonathan Corbet , "Luis R. Rodriguez" , Kees Cook Cc: Andrew Morton , Roman Gushchin , David Rientjes , Mike Kravetz , "Aneesh Kumar K.V" , Naoya Horiguchi , Anshuman Khandual , Marc-Andre Lureau , Punit Agrawal , Dan Williams , Vlastimil Babka , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, tsukada@ascade.co.jp 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 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, if (!page) return NULL; + surplus_hugepage_set_charge(h, page); + /* * We do not account these pages as surplus because they are only * temporary and will be released properly on the last reference -- Tsukada