Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4926065ybp; Mon, 14 Oct 2019 12:18:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+X4eh+q3h7k5oApe6Y7RX3yqOoXSd2ZmBli1MACN64EPRzTNZ6A3Aqrz0OA6AKGwgeEQP X-Received: by 2002:a17:906:c801:: with SMTP id cx1mr31008458ejb.266.1571080719954; Mon, 14 Oct 2019 12:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571080719; cv=none; d=google.com; s=arc-20160816; b=uYPJzkAaZO1SPGC9MtPb/KS5OTRcd3MTgfJBQIrKYUn6/LWJsWjm6gteZ7qxFGwFsI tQ9TLlsxY7R4VpKRxn/kmIFlurV8ECelz5s41ih1kGsNuNE9ypCKIBOeHlig7+3mIEuf q1OLoi8NvmQkqszvNd3YJUSDKM/I1ODhYs443oEdh36PnfoSmIBmQK9V63zyG1/TUcWy 4JKOO4xcdT0/iJT1G2aPoTmSTnlcIEkcCSBHeg4xTIq71Xgl+O1dxyQninrpgE1zpJx2 y+89FZMHoqd1W+32Fp/1S30Jb+Ec5soPv9A3NK5NdKuz8FqQtUsX5RS59rMZpxd3uKF9 HyHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=SgoPaXtNxXkqZxvIC3mKHam0uE1SQovKYmuch0B2NlQ=; b=WwmqWhKHwi7ELqbtKzZEloc1Y4e5T2Q3x5t3Rd0TnmLikoQSRm0nMzgXaXYaRq++M+ mp2FZKvduyxYnBwzeKJ2qUZphTGHrIm7i195a42tQs1Xk4iu3h6mLZs/YO7YEEp6pTtK seEwHM/+JH5DZfG7zxjSAeIqRoqW+6tnw6gFFnhU5cQvQKw5rl6xUQPmMEC1y3Jc62ew aMfABom4dDerHZVexEKJPEBYFHU22qTaAVihl0BBZ+Ico9Qz54lARDX8d5vAAnO59h/H jM7/w5aj+RTkjwAfDD1EgWUZ5HlcNgPv+ylhAVSZbC7uHOuTg/ST5MFeG+ojnFLCk2CH oa/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=DhDyMkuZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si10728562edk.115.2019.10.14.12.18.16; Mon, 14 Oct 2019 12:18:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=DhDyMkuZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388529AbfJNRdX (ORCPT + 99 others); Mon, 14 Oct 2019 13:33:23 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60128 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730307AbfJNRdW (ORCPT ); Mon, 14 Oct 2019 13:33:22 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9EHTRm2055532; Mon, 14 Oct 2019 17:33:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=SgoPaXtNxXkqZxvIC3mKHam0uE1SQovKYmuch0B2NlQ=; b=DhDyMkuZYE70IGS8w2tWI14yqTSd4ojJOq8VBEmTIOAJckSPdzfnWPzc4flTyhibnsbF Rjov5ug2GK6wQbwJRzkbk96SrugA2pLFHHgikNI74GFogfeUGnRoJsjr2OpsfiL39PTs YHE5N/R+9T8QXIHDz6J6mzga6yKxYFW/Wj5AoSZB8hb8NYNJ+cZ6soIWfsQeZHGBxYWe +rQ10X6ZL0Xl4Hzg76Zr3JVwnU6U8fkj5UxdGTLf6dlw9y0Edj+NJLvngXroOE0viV/m 6zS26bvgQFnbAvQ7YTkS8KBV+0hH2FhbtJKKxlSTSfzwqZ+WSSSXkTJoRxpMk2Z8fGER qA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2vk7fr2as5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Oct 2019 17:33:11 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9EHRtTl009294; Mon, 14 Oct 2019 17:33:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2vkry6shsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Oct 2019 17:33:11 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x9EHX9WA026469; Mon, 14 Oct 2019 17:33:09 GMT Received: from [192.168.1.222] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 14 Oct 2019 17:33:09 +0000 Subject: Re: [PATCH v5 0/7] hugetlb_cgroup: Add hugetlb_cgroup reservation limits To: Mina Almasry Cc: Aneesh Kumar , shuah , David Rientjes , Shakeel Butt , Greg Thelen , Andrew Morton , khalid.aziz@oracle.com, open list , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, =?UTF-8?Q?Michal_Koutn=c3=bd?= References: <20190919222421.27408-1-almasrymina@google.com> <3c73d2b7-f8d0-16bf-b0f0-86673c3e9ce3@oracle.com> From: Mike Kravetz Message-ID: Date: Mon, 14 Oct 2019 10:33:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9410 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910140146 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9410 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910140146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/19 1:41 PM, Mina Almasry wrote: > On Fri, Oct 11, 2019 at 12:10 PM Mina Almasry wrote: >> >> On Mon, Sep 23, 2019 at 10:47 AM Mike Kravetz wrote: >>> >>> On 9/19/19 3:24 PM, Mina Almasry wrote: >> >> Mike, note your suggestion above to check if the page hugetlb_cgroup >> is null doesn't work if we want to keep the current counter working >> the same: the page will always have a hugetlb_cgroup that points that >> contains the old counter. Any ideas how to apply this new counter >> behavior to a private NORESERVE mappings? Is there maybe a flag I can >> set on the pages at allocation time that I can read on free time to >> know whether to uncharge the hugetlb_cgroup or not? > > Reading the code and asking around a bit, it seems the pointer to the > hugetlb_cgroup is in page[2].private. Is it reasonable to use > page[3].private to store the hugetlb_cgroup to uncharge for the new > counter and increment HUGETLB_CGROUP_MIN_ORDER to 3? I think that > would solve my problem. When allocating a private NORESERVE page, set > page[3].private to the hugetlb_cgroup to uncharge, then on > free_huge_page, check page[3].private, if it is non-NULL, uncharge the > new counter on it. Sorry for not responding sooner. This approach should work, and it looks like you have a v6 of the series. I'll take a look. -- Mike Kravetz