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 E3649C35242 for ; Tue, 11 Feb 2020 21:51:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A504E20714 for ; Tue, 11 Feb 2020 21:51:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gTnVVwFT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A504E20714 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 3E1B86B033B; Tue, 11 Feb 2020 16:51:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 392286B033D; Tue, 11 Feb 2020 16:51:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 259806B033E; Tue, 11 Feb 2020 16:51:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 0F5026B033B for ; Tue, 11 Feb 2020 16:51:41 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BE0584826 for ; Tue, 11 Feb 2020 21:51:40 +0000 (UTC) X-FDA: 76479193560.25.worm73_82fc957f2c603 X-HE-Tag: worm73_82fc957f2c603 X-Filterd-Recvd-Size: 5385 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Feb 2020 21:51:39 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01BLh2m5065691; Tue, 11 Feb 2020 21:51:36 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-2020-01-29; bh=q9CJH8blGd3JpsYmKV23Sgj8OEPJrRzAG9QrB6xaUUE=; b=gTnVVwFTBUdHJ9eyfYo5Hmcz5SmP6JFCX2FdoK9AAaKAy4pE/nPnVjvP2xA7yiAfSd51 SV13Y+41lw/40Kz8+mkudhl4f25TKjG6pcLy27qm48RMTaC31bmONVIJdhxVoo6f3goM C+YrHyyim7kYOG4Zw1kkJb0PCJVT/QrAg1sN1TutWMj6YwjBqqkHVBWAJyf4LfxJN06C rH742UiXRU9FP7n9X6y6xBK/4QFovcvcwQZfpxznZUnsuJN0op3wgzcN8edxuaS1tjHD KQQdbyS8QaaV1L8dDKyhbmpWXBuTF6xK/4sVabr5eeelDDl4MbC9owbEyJZZZAUOOpXF vg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2y2p3se9s1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Feb 2020 21:51:36 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01BLgcbM108989; Tue, 11 Feb 2020 21:51:36 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2y26q21sym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Feb 2020 21:51:35 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01BLpYhE024620; Tue, 11 Feb 2020 21:51:34 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Feb 2020 13:51:34 -0800 Subject: Re: [PATCH v11 6/9] hugetlb_cgroup: support noreserve 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 References: <20200203232248.104733-1-almasrymina@google.com> <20200203232248.104733-6-almasrymina@google.com> <6cc406e7-757f-4922-ffc0-681df3ee0d18@oracle.com> From: Mike Kravetz Message-ID: <6b097a9d-3b2c-94cb-21a8-7e7a55a8f635@oracle.com> Date: Tue, 11 Feb 2020 13:51:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.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=9528 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=2 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002110141 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9528 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=2 mlxlogscore=999 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002110141 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/11/20 1:35 PM, Mina Almasry wrote: > On Thu, Feb 6, 2020 at 2:31 PM Mike Kravetz wrote: >> On 2/3/20 3:22 PM, Mina Almasry wrote: >>> +++ b/mm/hugetlb.c >>> @@ -1339,6 +1339,9 @@ static void __free_huge_page(struct page *page) >>> clear_page_huge_active(page); >>> hugetlb_cgroup_uncharge_page(hstate_index(h), pages_per_huge_page(h), >>> page, false); >>> + hugetlb_cgroup_uncharge_page(hstate_index(h), pages_per_huge_page(h), >>> + page, true); >>> + >> >> When looking at the code without change markings, the two above lines >> look so similar my first thought is there must be a mistake. >> >> A suggestion for better code readability: >> - hugetlb_cgroup_uncharge_page could just take "struct hstate *h" and >> get both hstate_index(h) and pages_per_huge_page(h). >> - Perhaps make hugetlb_cgroup_uncharge_page and >> hugetlb_cgroup_uncharge_page_rsvd be wrappers around a common routine. >> Then the above would look like: >> >> hugetlb_cgroup_uncharge_page(h, page); >> hugetlb_cgroup_uncharge_page_rsvd(h, page); >> > > I did modify the interfaces to this, as it's much better for > readability indeed. Unfortunately the patch the adds interfaces > probably needs a re-review now as it's changed quite a bit, I did not > carry your or David's Reviewed-by. No worries. Happy to review again. -- Mike Kravetz