From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEFEDC33C9E for ; Fri, 17 Jan 2020 22:09:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6708F2072E for ; Fri, 17 Jan 2020 22:09:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kW1I3h9C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6708F2072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B7DDF6B04F1; Fri, 17 Jan 2020 17:09:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2E306B04F2; Fri, 17 Jan 2020 17:09:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1D786B04F3; Fri, 17 Jan 2020 17:09:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 885246B04F1 for ; Fri, 17 Jan 2020 17:09:53 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 4D4DC2485 for ; Fri, 17 Jan 2020 22:09:53 +0000 (UTC) X-FDA: 76388519466.18.knot37_90721e7cc2d4e X-HE-Tag: knot37_90721e7cc2d4e X-Filterd-Recvd-Size: 5319 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jan 2020 22:09:52 +0000 (UTC) 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 00HM8HXd150359; Fri, 17 Jan 2020 22:09:48 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=HFFGUnfSqVWShYbKt3p582lD3bfMPINDrNFPG0jJqvE=; b=kW1I3h9CqDB0WI8iNf10+m0iPa1caxU1I2lL1DtfW2t6Uujt+6MaHhDAA108OOEPPtMf goLIn+mP/rVpqL+EO+HM0B7wM5FQpwXMNqCmaqcrB6Z600IT925wNPtfUgkBRPg35LZM Mo3dMDUo92fmDi4WY7wvg2kCn4OK3T3EzCi9VB+NxluNT0ym96Ld1u4W/C9uk8KvsMGr ALkR6o/MlhLR0mM5EhBRvTo5MSi/0IRdQQoo4d7fwn4ZOJsqxEcP9dswoYez6M29dLuT +cn9qJ0lC19z4UEYkqRZLSynbDNwNVrxZ4aMQ/66dfOuMU/4COFYdA4k5s46rgjTEbHD 5A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2xf74037wy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jan 2020 22:09:48 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00HM8mVc008512; Fri, 17 Jan 2020 22:09:48 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2xjxm9pau4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jan 2020 22:09:47 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00HM9iG3027286; Fri, 17 Jan 2020 22:09:44 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Jan 2020 14:09:44 -0800 Subject: Re: [PATCH v9 3/8] hugetlb_cgroup: add reservation accounting for private mappings To: Mina Almasry Cc: shuah , David Rientjes , Shakeel Butt , Greg Thelen , Andrew Morton , open list , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, Aneesh Kumar , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Hillf Danton References: <20191217231615.164161-1-almasrymina@google.com> <20191217231615.164161-3-almasrymina@google.com> From: Mike Kravetz Message-ID: <0ea993b0-af18-cee8-527e-f6df7e76b0be@oracle.com> Date: Fri, 17 Jan 2020 14:09:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 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=9503 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1911140001 definitions=main-2001170170 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9503 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1911140001 definitions=main-2001170170 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1/14/20 2:52 PM, Mina Almasry wrote: > On Mon, Jan 13, 2020 at 4:55 PM Mike Kravetz wrote: >>> +#ifdef CONFIG_CGROUP_HUGETLB >>> + /* >>> + * Since we check for HPAGE_RESV_OWNER above, this must a private >>> + * mapping, and these values should be none-zero, and should point to >>> + * the hugetlb_cgroup counter to uncharge for this reservation. >>> + */ >>> + WARN_ON(!resv->reservation_counter); >>> + WARN_ON(!resv->pages_per_hpage); >>> + WARN_ON(!resv->css); >> >> I was once again wondering if these were always non-NULL for private mappings. >> It seems that reservation_counter (h_gc) would be NULL in these cases from >> these early checks in hugetlb_cgroup_charge_cgroup(). >> > > You are right. I'm fixing in v10 the code and comments to account for > h_cg potentially being NULL, but I'm having trouble testing. Looking > at the code, I'm a bit confused by the checks. Seems to me > hugetlb_cgroup_disabled() is the same as #ifdef CONFIG_CGROUP_HUGETLB; > I can't find a way to enable the Kconfig but have that return false > unless I hack the code. What about the boot options? cgroup_disable= cgroup_no_v1= -- Mike Kravetz