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=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 1F482C34026 for ; Tue, 18 Feb 2020 18:07:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D796924649 for ; Tue, 18 Feb 2020 18:07:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="IM0UnXqN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D796924649 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 734536B0006; Tue, 18 Feb 2020 13:07:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E2596B0007; Tue, 18 Feb 2020 13:07:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AA596B0008; Tue, 18 Feb 2020 13:07:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 434C36B0006 for ; Tue, 18 Feb 2020 13:07:28 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D9324180AD807 for ; Tue, 18 Feb 2020 18:07:27 +0000 (UTC) X-FDA: 76504030134.24.woman06_23fdfe8a35f0c X-HE-Tag: woman06_23fdfe8a35f0c X-Filterd-Recvd-Size: 4572 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Feb 2020 18:07:27 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01II0qDX046730; Tue, 18 Feb 2020 18:07:24 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=e3JY76Nw6Z8qX70Yw+VTwQiabRUZeD/vVIWatfgrW04=; b=IM0UnXqNMAWDp5h99bss7p2XZ7UfyP25Jwa03tDvRTM57+ywGz+cVbLLpCHfSFgJYP3L 159R+3QwknVgwkxQ/q79T1rSf8YP/kABkV+A/zoGQeCdtwtHl+prT03PtTmG/QIk2MUB yIHNBHNa7FFPHxWL86DJUzFkdrnGapH0nBYRiMC6lhP1fRgjIDOh5qIEM/b5TErcsIbt W+UDZy2S3E1uJQJG9rffCMKlFMyEcNt0rze5VUSFJ0YB8XRsa0Cx6AxlfzerHgK00mAa 1yEaTrlz+VcdDWP7Pk5ixR+9utbhuNOCpiv7Rt2qz4affGYre6vrpO7USqriFDtJ1LHE NQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2y7aq5u4nv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 18:07:23 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01IHwFk9063735; Tue, 18 Feb 2020 18:07:23 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2y82c1vxf0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 18:07:23 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01II7LLD021385; Tue, 18 Feb 2020 18:07:21 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Feb 2020 10:07:21 -0800 Subject: Re: [PATCH v12 5/9] hugetlb_cgroup: add accounting for shared mappings To: Mina Almasry Cc: shuah@kernel.org, rientjes@google.com, shakeelb@google.com, gthelen@google.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org References: <20200211213128.73302-1-almasrymina@google.com> <20200211213128.73302-5-almasrymina@google.com> From: Mike Kravetz Message-ID: <40f86207-6f4d-1d00-b6ac-b837c20626ea@oracle.com> Date: Tue, 18 Feb 2020 10:07:19 -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: <20200211213128.73302-5-almasrymina@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180125 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 bulkscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180125 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 2/11/20 1:31 PM, Mina Almasry wrote: > For shared mappings, the pointer to the hugetlb_cgroup to uncharge lives > in the resv_map entries, in file_region->reservation_counter. > > After a call to region_chg, we charge the approprate hugetlb_cgroup, and if > successful, we pass on the hugetlb_cgroup info to a follow up region_add call. > When a file_region entry is added to the resv_map via region_add, we put the > pointer to that cgroup in file_region->reservation_counter. If charging doesn't > succeed, we report the error to the caller, so that the kernel fails the > reservation. > > On region_del, which is when the hugetlb memory is unreserved, we also uncharge > the file_region->reservation_counter. > > Signed-off-by: Mina Almasry With addition of the build fix, Reviewed-by: Mike Kravetz -- Mike Kravetz